From 8f237ff2712c2f13c88d73fc05988b4ea0343b73 Mon Sep 17 00:00:00 2001 From: Fangoboyo <77935781+Fangoboyo@users.noreply.github.com> Date: Fri, 10 Jun 2022 11:48:38 -0700 Subject: [PATCH] fixed the shit code --- .../nully/PluginInstaller/PluginList.java | 50 ++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/src/main/java/tech/nully/PluginInstaller/PluginList.java b/src/main/java/tech/nully/PluginInstaller/PluginList.java index eab6ad0..da9b81c 100644 --- a/src/main/java/tech/nully/PluginInstaller/PluginList.java +++ b/src/main/java/tech/nully/PluginInstaller/PluginList.java @@ -1,32 +1,46 @@ package tech.nully.PluginInstaller; +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import java.net.*; import java.io.*; +import java.util.List; public class PluginList { + private static String[] AlphaPluginList = new String[]{"AntiSwear", "BitchFilter", "CoreProtect", "CrackShot", "DupePatch", "DynMap", "Essentials", + "EssenttialsAntiBuild", "EssentialsChat", "EssentialsProtect", "EssentialsSpawn", "Factions", "MCore", "MyWarp",}; 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()); + sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:"); + int SecondCollumn = 8; + for (int i = 1; i < 8; i++) { + sender.sendMessage(i+". "+ AlphaPluginList[i-1] + "" +SecondCollumn + ". " + AlphaPluginList[SecondCollumn-1]); + SecondCollumn++; + } + sender.sendMessage(" Page 1 of 12"); + sender.sendMessage("Note: You do not need to have proper"); + sender.sendMessage("capitalization when using the install command"); + } + + public static void SendPG2ToSender(CommandSender sender) { + sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:"); + int SecondCollumn = 22; + for (int i = 15; i < 22; i++) { + String Col1 = ""; + String Col2 = ""; + if (AlphaPluginList[i-1] != null) { + Col1 = AlphaPluginList[i-1]; } - best.close(); + if (AlphaPluginList[SecondCollumn-1] != null) { + Col2 = AlphaPluginList[SecondCollumn-1]; + } + sender.sendMessage(i+". "+ Col1 + "" + SecondCollumn + ". " + Col2); + SecondCollumn++; } - 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. ");*/ - + + sender.sendMessage(" Page 2 of 12"); + sender.sendMessage("Note: You do not need to have proper"); + sender.sendMessage("capitalization when using the install command"); } }