diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/tech/nully/PluginInstaller/InstallCommand.java b/src/main/java/tech/nully/PluginInstaller/Commands/InstallCommand.java similarity index 97% rename from src/main/java/tech/nully/PluginInstaller/InstallCommand.java rename to src/main/java/tech/nully/PluginInstaller/Commands/InstallCommand.java index 03d9e12..c85395b 100644 --- a/src/main/java/tech/nully/PluginInstaller/InstallCommand.java +++ b/src/main/java/tech/nully/PluginInstaller/Commands/InstallCommand.java @@ -1,10 +1,11 @@ -package tech.nully.PluginInstaller; +package tech.nully.PluginInstaller.Commands; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; +import tech.nully.PluginInstaller.Installer; import java.io.IOException; import java.io.InputStream; @@ -68,6 +69,7 @@ public class InstallCommand implements CommandExecutor { } } catch (IOException e) { snder.sendMessage("\"" + Install_Jar + "\"" + "is not a valid plugin from the database"); + return true; } } } diff --git a/src/main/java/tech/nully/PluginInstaller/Commands/pinfoCommand.java b/src/main/java/tech/nully/PluginInstaller/Commands/pinfoCommand.java new file mode 100644 index 0000000..c730c32 --- /dev/null +++ b/src/main/java/tech/nully/PluginInstaller/Commands/pinfoCommand.java @@ -0,0 +1,13 @@ +package tech.nully.PluginInstaller.Commands; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class pinfoCommand implements CommandExecutor { + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + + return false; + } +} diff --git a/src/main/java/tech/nully/PluginInstaller/plistCommand.java b/src/main/java/tech/nully/PluginInstaller/Commands/plistCommand.java similarity index 94% rename from src/main/java/tech/nully/PluginInstaller/plistCommand.java rename to src/main/java/tech/nully/PluginInstaller/Commands/plistCommand.java index 2c1fdbf..abd373e 100644 --- a/src/main/java/tech/nully/PluginInstaller/plistCommand.java +++ b/src/main/java/tech/nully/PluginInstaller/Commands/plistCommand.java @@ -1,10 +1,11 @@ -package tech.nully.PluginInstaller; +package tech.nully.PluginInstaller.Commands; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; +import tech.nully.PluginInstaller.PluginList; public class plistCommand implements CommandExecutor { @Override diff --git a/src/main/java/tech/nully/PluginInstaller/Main.java b/src/main/java/tech/nully/PluginInstaller/Main.java index e666451..68a386b 100644 --- a/src/main/java/tech/nully/PluginInstaller/Main.java +++ b/src/main/java/tech/nully/PluginInstaller/Main.java @@ -1,19 +1,23 @@ package tech.nully.PluginInstaller; import org.bukkit.ChatColor; +import org.bukkit.command.ConsoleCommandSender; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; +import tech.nully.PluginInstaller.Commands.InstallCommand; +import tech.nully.PluginInstaller.Commands.plistCommand; import java.io.IOException; -import java.util.HashMap; public class Main extends JavaPlugin { private static Plugin instance = null; public static Plugin getInstance() { return instance; } + private static ConsoleCommandSender ConsoleSender; @Override public void onEnable() { + ConsoleSender = getServer().getConsoleSender(); instance = this; try { Installer.InstallUpdater(); @@ -22,25 +26,25 @@ public class Main extends JavaPlugin { } getCommand("install").setExecutor(new InstallCommand()); getCommand("plist").setExecutor(new plistCommand()); - getServer().getConsoleSender().sendMessage("--------------------------------------------"); - getServer().getConsoleSender().sendMessage("--------------------------------------------"); - getServer().getConsoleSender().sendMessage( + ConsoleSender.sendMessage("--------------------------------------------"); + ConsoleSender.sendMessage("--------------------------------------------"); + ConsoleSender.sendMessage( ChatColor.GREEN + "[EaglerPluginInstaller]" + ChatColor.AQUA + " EaglerPluginInstaller V1.1.2 is now Enabled! :D"); - getServer().getConsoleSender().sendMessage("To use PluginInstaller, run the command \"/install \" (\"install \" in console) to install a plugin"); - getServer().getConsoleSender().sendMessage("To get a list of installable plugins, use the command \"/plist\" or \"plist\" in console"); - getServer().getConsoleSender().sendMessage("You can request to add a new plugin to the database by going to https://github.com/darverdevs/PluginInstallerRepo/tree/main"); - getServer().getConsoleSender().sendMessage("and creating an issue or pull request of the plugin you want to add"); - getServer().getConsoleSender().sendMessage("--------------------------------------------"); - getServer().getConsoleSender().sendMessage("--------------------------------------------"); + ConsoleSender.sendMessage("To use PluginInstaller, run the command \"/install \" (\"install \" in console) to install a plugin"); + ConsoleSender.sendMessage("To get a list of installable plugins, use the command \"/plist\" or \"plist\" in console"); + ConsoleSender.sendMessage("You can request to add a new plugin to the database by going to https://github.com/darverdevs/PluginInstallerRepo/tree/main"); + ConsoleSender.sendMessage("and creating an issue or pull request of the plugin you want to add"); + ConsoleSender.sendMessage("--------------------------------------------"); + ConsoleSender.sendMessage("--------------------------------------------"); } @Override public void onDisable() { - getServer().getConsoleSender().sendMessage("--------------------------------------------"); - getServer().getConsoleSender().sendMessage("--------------------------------------------"); - getServer().getConsoleSender().sendMessage( + ConsoleSender.sendMessage("--------------------------------------------"); + ConsoleSender.sendMessage("--------------------------------------------"); + ConsoleSender.sendMessage( ChatColor.GREEN + "[EaglerPluginInstaller]" + ChatColor.AQUA + " PluginInstaller V1.1.2 is now Disabled! D:"); - getServer().getConsoleSender().sendMessage("--------------------------------------------"); - getServer().getConsoleSender().sendMessage("--------------------------------------------"); + ConsoleSender.sendMessage("--------------------------------------------"); + ConsoleSender.sendMessage("--------------------------------------------"); } }