mirror of
https://github.com/darverdevs/PluginInstaller.git
synced 2024-12-21 23:04:12 -08:00
commit
819cf990e5
|
@ -3,6 +3,7 @@
|
|||
<output-path>$PROJECT_DIR$/out/artifacts/EaglerPluginInstaller_jar</output-path>
|
||||
<root id="archive" name="EaglerPluginInstaller.jar">
|
||||
<element id="module-output" name="EaglerPluginInstaller" />
|
||||
<element id="library" level="project" name="Maven: com.googlecode.json-simple:json-simple:1.1" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
Binary file not shown.
5
pom.xml
5
pom.xml
|
@ -33,6 +33,11 @@
|
|||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.5.2-R1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
|
|
@ -35,15 +35,23 @@ public class InstallCommand implements CommandExecutor {
|
|||
try (InputStream in = plugin.openStream()) {
|
||||
|
||||
// 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!");
|
||||
return true;
|
||||
} catch (IOException e) {}
|
||||
} else if (Install_Jar.equalsIgnoreCase("recommended")) {
|
||||
InputStream reco1 = URI.create("https://github.com/darverdevs/PluginInstallerRepo/raw/main/dupepatch.jar")
|
||||
.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");
|
||||
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;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -25,7 +25,7 @@ public class Main extends JavaPlugin {
|
|||
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 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");
|
||||
|
@ -39,7 +39,7 @@ public class Main extends JavaPlugin {
|
|||
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("--------------------------------------------");
|
||||
}
|
||||
|
|
103
src/main/java/tech/nully/PluginInstaller/PluginList.java
Normal file
103
src/main/java/tech/nully/PluginInstaller/PluginList.java
Normal file
|
@ -0,0 +1,103 @@
|
|||
package tech.nully.PluginInstaller;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PluginList {
|
||||
private static String[] AlphaPluginList = new String[]{"AntiSwear", "AyunCord", "BitchFilter", "CoreProtect", "CrackShot", "CraftBook", "DupePatch", "DynMap", "Essentials",
|
||||
"EssenttialsAntiBuild", "EssentialsChat", "EssentialsProtect", "EssentialsSpawn", "Factions", "MCore", "Multiverse", "MyWarp", "PermissionSex", "ProtocolLib",
|
||||
"Vault", "WorldEdit", "WorldGuard"};
|
||||
public static void SendPG1ToSender(CommandSender sender) {
|
||||
sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:");
|
||||
int SecondCollumn = 8;
|
||||
|
||||
for (int i = 1; i < 8; i++) {
|
||||
int Spaces = 21-AlphaPluginList[i-1].length();
|
||||
List<String> spaces = new ArrayList<>();
|
||||
for (int forInt = 0; forInt < Spaces; forInt++) {
|
||||
spaces.add(" ");
|
||||
}
|
||||
sender.sendMessage(i+". "+ AlphaPluginList[i-1] + "" + Utils.ListToString(spaces) + "" +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:");
|
||||
|
||||
// List -------------------------------------------------------------
|
||||
int SecondCollumn = 22;
|
||||
for (int i = 15; i < 22; i++) {
|
||||
String Col1;
|
||||
String Col2;
|
||||
|
||||
// Null checkers for elements in the Array
|
||||
try {
|
||||
Col1 = AlphaPluginList[i-1];
|
||||
} catch (ArrayIndexOutOfBoundsException y) {
|
||||
Col1 = "N/A";
|
||||
}
|
||||
try {
|
||||
Col2 = AlphaPluginList[SecondCollumn-1];
|
||||
} catch (ArrayIndexOutOfBoundsException a) {
|
||||
Col2 = "N/A";
|
||||
}
|
||||
// _________________________________________
|
||||
|
||||
int Spaces = 21-AlphaPluginList[i-1].length();
|
||||
List<String> spaces = new ArrayList<>();
|
||||
for (int forInt = 0; forInt < Spaces; forInt++) {
|
||||
spaces.add(" ");
|
||||
}
|
||||
sender.sendMessage(i+". "+ Col1 + "" + Utils.ListToString(spaces) + "" + SecondCollumn + ". " + Col2);
|
||||
SecondCollumn++;
|
||||
}
|
||||
|
||||
sender.sendMessage(" Page 2 of 12");
|
||||
sender.sendMessage("Note: You do not need to have proper");
|
||||
sender.sendMessage("capitalization when using the install command");
|
||||
}
|
||||
|
||||
public static void SendPG3ToSender(CommandSender sender) {
|
||||
sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:");
|
||||
|
||||
// List -------------------------------------------------------------
|
||||
int SecondCollumn = 36;
|
||||
for (int i = 29; i < 36; i++) {
|
||||
String Col31;
|
||||
String Col32;
|
||||
|
||||
// Null checkers for elements in the Array
|
||||
try {
|
||||
Col31 = AlphaPluginList[i-1];
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
Col31 = "N/A";
|
||||
}
|
||||
try {
|
||||
Col32 = AlphaPluginList[SecondCollumn-1];
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
Col32 = "N/A";
|
||||
}
|
||||
// _________________________________________
|
||||
|
||||
int Spaces = 21-Col31.length();
|
||||
List<String> spaces = new ArrayList<>();
|
||||
for (int forInt = 0; forInt < Spaces; forInt++) {
|
||||
spaces.add(" ");
|
||||
}
|
||||
sender.sendMessage(i+". "+ Col31 + "" + Utils.ListToString(spaces) + "" + SecondCollumn + ". " + Col32);
|
||||
SecondCollumn++;
|
||||
}
|
||||
|
||||
sender.sendMessage(" Page 3 of 12");
|
||||
sender.sendMessage("Note: You do not need to have proper");
|
||||
sender.sendMessage("capitalization when using the install command");
|
||||
}
|
||||
}
|
||||
|
21
src/main/java/tech/nully/PluginInstaller/Utils.java
Normal file
21
src/main/java/tech/nully/PluginInstaller/Utils.java
Normal file
|
@ -0,0 +1,21 @@
|
|||
package tech.nully.PluginInstaller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Utils {
|
||||
public static String ArrayToString(String[] str) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : str) {
|
||||
sb.append(s);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String ListToString(List<String> list) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : list) {
|
||||
sb.append(s);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
|
@ -4,21 +4,44 @@ import org.bukkit.ChatColor;
|
|||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
|
||||
public class plistCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (cmd.getName().equalsIgnoreCase("plist")) {
|
||||
sender.sendMessage(ChatColor.GREEN + "Here is a list of available plugins in the database:");
|
||||
// TODO: Finish this list
|
||||
sender.sendMessage("1. Factions 8. AntiSwear");
|
||||
sender.sendMessage("2. ProtocolLib 9. ProtocolLib");
|
||||
sender.sendMessage("3. PermissionSex 10. MCore");
|
||||
sender.sendMessage("4. Vault 11. ");
|
||||
sender.sendMessage("5. CoreProtect 12. ");
|
||||
sender.sendMessage("6. DupePatch 13. ");
|
||||
sender.sendMessage("7. BitchFilter 14. ");
|
||||
}
|
||||
if (cmd.getName().equalsIgnoreCase("plist") && sender.isOp() || sender instanceof ConsoleCommandSender) {
|
||||
if (args.length >= 1) {
|
||||
try {
|
||||
System.out.println(args[0]);
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
System.out.println("error");
|
||||
}
|
||||
int listPage = 0;
|
||||
boolean PageArgIsInt = false;
|
||||
try {
|
||||
listPage= Integer.parseInt(args[0]);
|
||||
PageArgIsInt = true;
|
||||
} catch (NumberFormatException n) {
|
||||
sender.sendMessage(ChatColor.RED + "That is not a valid page number!");
|
||||
PageArgIsInt = false;
|
||||
return true;
|
||||
}
|
||||
if (PageArgIsInt) {
|
||||
int PageArg = Integer.parseInt(args[0]);
|
||||
switch (PageArg) {
|
||||
case 1:
|
||||
PluginList.SendPG1ToSender(sender);
|
||||
return true;
|
||||
case 2:
|
||||
PluginList.SendPG2ToSender(sender);
|
||||
return true;
|
||||
case 3:
|
||||
PluginList.SendPG3ToSender(sender);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
name: EaglerPluginInstaller
|
||||
version: 1.1.0
|
||||
version: 1.1.1
|
||||
main: tech.nully.PluginInstaller.Main
|
||||
prefix: [EaglerPluginInstaller]
|
||||
loadbefore: [EaglerPluginUpdater]
|
||||
authors: [BongoCat]
|
||||
description: A plugin that is capable of installing the latest compatible version of plugins with eaglercraft from an online repository
|
||||
description: A plugin that is capable of installing the latest compatible version of plugins with eaglercraft from an online repository weith the executing of a command.
|
||||
website: nully.tech
|
||||
commands:
|
||||
install:
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
name: EaglerPluginInstaller
|
||||
version: 1.1.0
|
||||
version: 1.1.1
|
||||
main: tech.nully.PluginInstaller.Main
|
||||
prefix: [EaglerPluginInstaller]
|
||||
loadbefore: [EaglerPluginUpdater]
|
||||
authors: [BongoCat]
|
||||
description: A plugin that is capable of installing the latest compatible version of plugins with eaglercraft from an online repository
|
||||
description: A plugin that is capable of installing the latest compatible version of plugins with eaglercraft from an online repository weith the executing of a command.
|
||||
website: nully.tech
|
||||
commands:
|
||||
install:
|
||||
|
|
Binary file not shown.
Binary file not shown.
BIN
target/classes/tech/nully/PluginInstaller/PluginList.class
Normal file
BIN
target/classes/tech/nully/PluginInstaller/PluginList.class
Normal file
Binary file not shown.
BIN
target/classes/tech/nully/PluginInstaller/Utils.class
Normal file
BIN
target/classes/tech/nully/PluginInstaller/Utils.class
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user