|
| 1 | +package tech.nully.PluginInstaller; |
| 2 | + |
| 3 | +import org.bukkit.ChatColor; |
| 4 | +import org.bukkit.command.CommandSender; |
| 5 | + |
| 6 | +import java.util.ArrayList; |
| 7 | +import java.util.List; |
| 8 | + |
| 9 | +public class PluginList { |
| 10 | + private static String[] AlphaPluginList = new String[]{"AntiSwear", "AyunCord", "BitchFilter", "CoreProtect", "CrackShot", "CraftBook", "DupePatch", "DynMap", "Essentials", |
| 11 | + "EssenttialsAntiBuild", "EssentialsChat", "EssentialsProtect", "EssentialsSpawn", "Factions", "MCore", "Multiverse", "MyWarp", "PermissionSex", "ProtocolLib", |
| 12 | + "Vault", "WorldEdit", "WorldGuard"}; |
| 13 | + public static void SendPG1ToSender(CommandSender sender) { |
| 14 | + sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:"); |
| 15 | + int SecondCollumn = 8; |
| 16 | + |
| 17 | + for (int i = 1; i < 8; i++) { |
| 18 | + int Spaces = 21-AlphaPluginList[i-1].length(); |
| 19 | + List<String> spaces = new ArrayList<>(); |
| 20 | + for (int forInt = 0; forInt < Spaces; forInt++) { |
| 21 | + spaces.add(" "); |
| 22 | + } |
| 23 | + sender.sendMessage(i+". "+ AlphaPluginList[i-1] + "" + Utils.ListToString(spaces) + "" +SecondCollumn + ". " + AlphaPluginList[SecondCollumn-1]); |
| 24 | + SecondCollumn++; |
| 25 | + } |
| 26 | + sender.sendMessage(" Page 1 of 12"); |
| 27 | + sender.sendMessage("Note: You do not need to have proper"); |
| 28 | + sender.sendMessage("capitalization when using the install command"); |
| 29 | + } |
| 30 | + |
| 31 | + public static void SendPG2ToSender(CommandSender sender) { |
| 32 | + sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:"); |
| 33 | + |
| 34 | + // List ------------------------------------------------------------- |
| 35 | + int SecondCollumn = 22; |
| 36 | + for (int i = 15; i < 22; i++) { |
| 37 | + String Col1; |
| 38 | + String Col2; |
| 39 | + |
| 40 | + // Null checkers for elements in the Array |
| 41 | + try { |
| 42 | + Col1 = AlphaPluginList[i-1]; |
| 43 | + } catch (ArrayIndexOutOfBoundsException y) { |
| 44 | + Col1 = "N/A"; |
| 45 | + } |
| 46 | + try { |
| 47 | + Col2 = AlphaPluginList[SecondCollumn-1]; |
| 48 | + } catch (ArrayIndexOutOfBoundsException a) { |
| 49 | + Col2 = "N/A"; |
| 50 | + } |
| 51 | + // _________________________________________ |
| 52 | + |
| 53 | + int Spaces = 21-AlphaPluginList[i-1].length(); |
| 54 | + List<String> spaces = new ArrayList<>(); |
| 55 | + for (int forInt = 0; forInt < Spaces; forInt++) { |
| 56 | + spaces.add(" "); |
| 57 | + } |
| 58 | + sender.sendMessage(i+". "+ Col1 + "" + Utils.ListToString(spaces) + "" + SecondCollumn + ". " + Col2); |
| 59 | + SecondCollumn++; |
| 60 | + } |
| 61 | + |
| 62 | + sender.sendMessage(" Page 2 of 12"); |
| 63 | + sender.sendMessage("Note: You do not need to have proper"); |
| 64 | + sender.sendMessage("capitalization when using the install command"); |
| 65 | + } |
| 66 | + |
| 67 | + public static void SendPG3ToSender(CommandSender sender) { |
| 68 | + sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:"); |
| 69 | + |
| 70 | + // List ------------------------------------------------------------- |
| 71 | + int SecondCollumn = 36; |
| 72 | + for (int i = 29; i < 36; i++) { |
| 73 | + String Col31; |
| 74 | + String Col32; |
| 75 | + |
| 76 | + // Null checkers for elements in the Array |
| 77 | + try { |
| 78 | + Col31 = AlphaPluginList[i-1]; |
| 79 | + } catch (ArrayIndexOutOfBoundsException e) { |
| 80 | + Col31 = "N/A"; |
| 81 | + } |
| 82 | + try { |
| 83 | + Col32 = AlphaPluginList[SecondCollumn-1]; |
| 84 | + } catch (ArrayIndexOutOfBoundsException e) { |
| 85 | + Col32 = "N/A"; |
| 86 | + } |
| 87 | + // _________________________________________ |
| 88 | + |
| 89 | + int Spaces = 21-Col31.length(); |
| 90 | + List<String> spaces = new ArrayList<>(); |
| 91 | + for (int forInt = 0; forInt < Spaces; forInt++) { |
| 92 | + spaces.add(" "); |
| 93 | + } |
| 94 | + sender.sendMessage(i+". "+ Col31 + "" + Utils.ListToString(spaces) + "" + SecondCollumn + ". " + Col32); |
| 95 | + SecondCollumn++; |
| 96 | + } |
| 97 | + |
| 98 | + sender.sendMessage(" Page 3 of 12"); |
| 99 | + sender.sendMessage("Note: You do not need to have proper"); |
| 100 | + sender.sendMessage("capitalization when using the install command"); |
| 101 | + } |
| 102 | +} |
| 103 | + |
0 commit comments