Changed suggested plugins and changed plugin version text

This commit is contained in:
Fangoboyo 2022-06-09 12:29:31 -07:00
parent ed0174d8c1
commit 8c7b656a74
5 changed files with 69 additions and 15 deletions

View File

@ -35,15 +35,23 @@ public class InstallCommand implements CommandExecutor {
try (InputStream in = plugin.openStream()) { try (InputStream in = plugin.openStream()) {
// Installs the plugin // Installs the plugin
ins.InstallPlugin(in, Install_Jar.toLowerCase()); ins.InstallPlugin(in, Install_Jar.substring(0, 1).toUpperCase() + Install_Jar.substring(1));
snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + Install_Jar.toUpperCase() + ChatColor.WHITE + " plugin!"); snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + Install_Jar.toUpperCase() + ChatColor.WHITE + " plugin!");
return true; return true;
} catch (IOException e) {} } catch (IOException e) {}
} else if (Install_Jar.equalsIgnoreCase("recommended")) { } else if (Install_Jar.equalsIgnoreCase("recommended")) {
InputStream reco1 = URI.create("https://github.com/darverdevs/PluginInstallerRepo/raw/main/dupepatch.jar") InputStream reco1 = URI.create("https://github.com/darverdevs/PluginInstallerRepo/raw/main/dupepatch.jar")
.toURL().openStream(); .toURL().openStream();
InputStream reco2 = URI.create("https://github.com/darverdevs/PluginInstallerRepo/raw/main/essentials.jar")
.toURL().openStream();
InputStream reco3 = URI.create("https://github.com/darverdevs/PluginInstallerRepo/raw/main/essentialsspawn.jar")
.toURL().openStream();
ins.InstallPlugin(reco1, "DupePatch"); ins.InstallPlugin(reco1, "DupePatch");
snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + "DupePatch" + ChatColor.WHITE + " plugin!"); snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + "DupePatch" + ChatColor.WHITE + " plugin!");
ins.InstallPlugin(reco1, "Essentials");
snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + "Essentials" + ChatColor.WHITE + " plugin!");
ins.InstallPlugin(reco1, "EssentialsSpawn");
snder.sendMessage("You have successfully installed the " + ChatColor.GREEN + "EssentialsSpawn" + ChatColor.WHITE + " plugin!");
return true; return true;
} }
} catch (IOException e) { } catch (IOException e) {

View File

@ -25,7 +25,7 @@ public class Main extends JavaPlugin {
getServer().getConsoleSender().sendMessage("--------------------------------------------"); getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage("--------------------------------------------"); getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage( getServer().getConsoleSender().sendMessage(
ChatColor.GREEN + "[EaglerPluginInstaller]" + ChatColor.AQUA + " EaglerPluginInstaller V1.1.0 is now Enabled! :D"); ChatColor.GREEN + "[EaglerPluginInstaller]" + ChatColor.AQUA + " EaglerPluginInstaller V1.1.1 is now Enabled! :D");
getServer().getConsoleSender().sendMessage("To use PluginInstaller, run the command \"/install <pluginname>\" (\"install <pluginname>\" in console) to install a plugin"); getServer().getConsoleSender().sendMessage("To use PluginInstaller, run the command \"/install <pluginname>\" (\"install <pluginname>\" 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("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("You can request to add a new plugin to the database by going to https://github.com/darverdevs/PluginInstallerRepo/tree/main");
@ -39,7 +39,7 @@ public class Main extends JavaPlugin {
getServer().getConsoleSender().sendMessage("--------------------------------------------"); getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage("--------------------------------------------"); getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage( getServer().getConsoleSender().sendMessage(
ChatColor.GREEN + "[EaglerPluginInstaller]" + ChatColor.AQUA + " PluginInstaller V1.1.0 is now Disabled! D:"); ChatColor.GREEN + "[EaglerPluginInstaller]" + ChatColor.AQUA + " PluginInstaller V1.1.1 is now Disabled! D:");
getServer().getConsoleSender().sendMessage("--------------------------------------------"); getServer().getConsoleSender().sendMessage("--------------------------------------------");
getServer().getConsoleSender().sendMessage("--------------------------------------------"); getServer().getConsoleSender().sendMessage("--------------------------------------------");
} }

View File

@ -0,0 +1,32 @@
package tech.nully.PluginInstaller;
import org.bukkit.command.CommandSender;
import java.net.*;
import java.io.*;
public class PluginList {
public static void SendPG1ToSender(CommandSender sender) {
try {
URL files = URI.create("https://raw.githubusercontent.com/darverdevs/PluginInstallerRepo/main/names.txt").toURL();
URLConnection file = files.openConnection();
BufferedReader best = new BufferedReader(new InputStreamReader(file.getInputStream()));
while ((best.readLine() != null)) {
sender.sendMessage(best.readLine());
}
best.close();
}
catch(IOException io) {
System.out.println(io.getMessage());
}
/*sender.sendMessage("1. AntiSwear 8. AntiSwear");
sender.sendMessage("2. BitchFilter 9. ProtocolLib");
sender.sendMessage("3. CoreProtect 10. MCore");
sender.sendMessage("4. CrackShot 11. ");
sender.sendMessage("5. DupePatch 12. ");
sender.sendMessage("6. DynMap 13. ");
sender.sendMessage("7. BitchFilter 14. ");*/
}
}

View File

@ -4,20 +4,34 @@ import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
public class plistCommand implements CommandExecutor { public class plistCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("plist")) { if (cmd.getName().equalsIgnoreCase("plist") && sender.isOp() || sender instanceof ConsoleCommandSender) {
if (args.length >= 1) {
if (args[0] == null) {
sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:"); sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:");
// TODO: Finish this list // TODO: Finish this list
sender.sendMessage("1. Factions 8. AntiSwear"); PluginList.SendPG1ToSender(sender);
sender.sendMessage("2. ProtocolLib 9. ProtocolLib"); return true;
sender.sendMessage("3. PermissionSex 10. MCore"); }
sender.sendMessage("4. Vault 11. "); int listPage = 0;
sender.sendMessage("5. CoreProtect 12. "); boolean PageArgIsInt = false;
sender.sendMessage("6. DupePatch 13. "); try {
sender.sendMessage("7. BitchFilter 14. "); listPage= Integer.parseInt(args[0]);
PageArgIsInt = true;
} catch (NumberFormatException n) {
sender.sendMessage(ChatColor.RED + "That is not a valid page number!");
PageArgIsInt = false;
return false;
}
if (PageArgIsInt) {
}
}
} }
return false; return false;
} }

View File

@ -1,5 +1,5 @@
name: EaglerPluginInstaller name: EaglerPluginInstaller
version: 1.1.0 version: 1.1.1
main: tech.nully.PluginInstaller.Main main: tech.nully.PluginInstaller.Main
prefix: [EaglerPluginInstaller] prefix: [EaglerPluginInstaller]
loadbefore: [EaglerPluginUpdater] loadbefore: [EaglerPluginUpdater]