|
1 | 1 | package tech.nully.PluginInstaller; |
2 | 2 |
|
| 3 | +import org.bukkit.ChatColor; |
3 | 4 | import org.bukkit.command.CommandSender; |
4 | 5 |
|
5 | 6 | import java.net.*; |
6 | 7 | import java.io.*; |
| 8 | +import java.util.List; |
7 | 9 |
|
8 | 10 | public class PluginList { |
| 11 | + private static String[] AlphaPluginList = new String[]{"AntiSwear", "BitchFilter", "CoreProtect", "CrackShot", "DupePatch", "DynMap", "Essentials", |
| 12 | + "EssenttialsAntiBuild", "EssentialsChat", "EssentialsProtect", "EssentialsSpawn", "Factions", "MCore", "MyWarp",}; |
9 | 13 | public static void SendPG1ToSender(CommandSender sender) { |
10 | | - try { |
11 | | - URL files = URI.create("https://raw.githubusercontent.com/darverdevs/PluginInstallerRepo/main/names.txt").toURL(); |
12 | | - URLConnection file = files.openConnection(); |
13 | | - BufferedReader best = new BufferedReader(new InputStreamReader(file.getInputStream())); |
14 | | - while ((best.readLine() != null)) { |
15 | | - sender.sendMessage(best.readLine()); |
16 | | - } |
17 | | - best.close(); |
| 14 | + sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:"); |
| 15 | + int SecondCollumn = 8; |
| 16 | + for (int i = 1; i < 8; i++) { |
| 17 | + sender.sendMessage(i+". "+ AlphaPluginList[i-1] + "" +SecondCollumn + ". " + AlphaPluginList[SecondCollumn-1]); |
| 18 | + SecondCollumn++; |
18 | 19 | } |
19 | | - catch(IOException io) { |
20 | | - System.out.println(io.getMessage()); |
| 20 | + sender.sendMessage(" Page 1 of 12"); |
| 21 | + sender.sendMessage("Note: You do not need to have proper"); |
| 22 | + sender.sendMessage("capitalization when using the install command"); |
| 23 | + } |
| 24 | + |
| 25 | + public static void SendPG2ToSender(CommandSender sender) { |
| 26 | + sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:"); |
| 27 | + int SecondCollumn = 22; |
| 28 | + for (int i = 15; i < 22; i++) { |
| 29 | + String Col1 = ""; |
| 30 | + String Col2 = ""; |
| 31 | + if (AlphaPluginList[i-1] != null) { |
| 32 | + Col1 = AlphaPluginList[i-1]; |
| 33 | + } |
| 34 | + if (AlphaPluginList[SecondCollumn-1] != null) { |
| 35 | + Col2 = AlphaPluginList[SecondCollumn-1]; |
| 36 | + } |
| 37 | + sender.sendMessage(i+". "+ Col1 + "" + SecondCollumn + ". " + Col2); |
| 38 | + SecondCollumn++; |
21 | 39 | } |
22 | | - /*sender.sendMessage("1. AntiSwear 8. AntiSwear"); |
23 | | - sender.sendMessage("2. BitchFilter 9. ProtocolLib"); |
24 | | - sender.sendMessage("3. CoreProtect 10. MCore"); |
25 | | - sender.sendMessage("4. CrackShot 11. "); |
26 | | - sender.sendMessage("5. DupePatch 12. "); |
27 | | - sender.sendMessage("6. DynMap 13. "); |
28 | | - sender.sendMessage("7. BitchFilter 14. ");*/ |
29 | | - |
| 40 | + |
| 41 | + sender.sendMessage(" Page 2 of 12"); |
| 42 | + sender.sendMessage("Note: You do not need to have proper"); |
| 43 | + sender.sendMessage("capitalization when using the install command"); |
30 | 44 | } |
31 | 45 | } |
32 | 46 |
|
0 commit comments