diff --git a/CommandGUI V2/pom.xml b/CommandGUI V2/pom.xml index 6762ed1..72cf626 100644 --- a/CommandGUI V2/pom.xml +++ b/CommandGUI V2/pom.xml @@ -6,7 +6,7 @@ net.t2code CommandGUI_V2 - 2.8.3 + 2.8.4 jar CommandGUI @@ -53,10 +53,7 @@ - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - + Builders-Paradise https://repo.t2code.net/repository/Builders-Paradise/ @@ -65,6 +62,7 @@ T2Code https://repo.t2code.net/repository/T2Code/ + placeholderapi https://repo.extendedclip.com/content/repositories/placeholderapi/ @@ -72,26 +70,12 @@ + net.t2code bungee 1615 - - net.t2code - PlugmanGUI - 3.0 - - - net.t2code - T2CodeLib - 12.1 - - - net.t2code - LuckyBox-API - 4.2.2 - net.t2code.minecraft.1_16.r2 spigot @@ -107,6 +91,29 @@ spigot 1.8r1 + + net.t2code + PlugmanGUI + 3.0 + + + net.t2code + T2CodeLib + 12.1 + + + net.t2code + LuckyBox-API + 4.2.2 + + + + me.clip + placeholderapi + 2.11.1 + provided + + com.zaxxer HikariCP @@ -122,11 +129,6 @@ slf4j-api 1.7.22 - - me.clip - placeholderapi - 2.11.1 - provided - + diff --git a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BListener.java b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BListener.java index f8d01e5..51fb79c 100644 --- a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BListener.java +++ b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BListener.java @@ -1,8 +1,5 @@ package de.jatitv.commandguiv2.Bungee; -import de.jatitv.commandguiv2.Spigot.Main; -import de.jatitv.commandguiv2.Spigot.objects.Obj_Select; -import de.jatitv.commandguiv2.Util; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -35,7 +32,6 @@ public class BListener implements Listener { } } } catch (IOException e) { - Main.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]); e.printStackTrace(); } } diff --git a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMain.java b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMain.java index 75a266f..1e363e5 100644 --- a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMain.java +++ b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMain.java @@ -69,7 +69,7 @@ public final class BMain extends Plugin { Bsend.console(prefix + "§4=============================================================================="); } - public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) { + public static Boolean pluginNotFound(String pl, Integer spigotID, String ver) { if (ProxyServer.getInstance().getPluginManager().getPlugin(pl) == null) { plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " + @@ -78,10 +78,19 @@ public final class BMain extends Plugin { BMain.plugin.onDisable(); return true; } else { - if (Double.parseDouble(ProxyServer.getInstance().getPluginManager().getPlugin(pl).getDescription().getVersion()) < ver) { + String plVer = ProxyServer.getInstance().getPluginManager().getPlugin(pl).getDescription().getVersion(); + if (ver.contains("_")) { + if (!plVer.equals(ver)) { + plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); + ProxyServer.getInstance().getConsole().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires the version §2" + ver + " §4of §6" + pl + " §4Please use this version! Please download it here or contact us in Discord: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " Or contact us in Discord: http://dc.t2code.net"); + return true; + } + return false; + } + String[] split = plVer.split("_"); + if (Double.parseDouble(split[0]) < Double.parseDouble(ver)) { plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + "."); - // BMain.plugin.getPluginLoader().disablePlugin(BMain.plugin); BMain.plugin.onDisable(); return true; } diff --git a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Main.java b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Main.java index 2bf981e..c0eaa81 100644 --- a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Main.java +++ b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Main.java @@ -85,27 +85,32 @@ public final class Main extends JavaPlugin { send.console(Util.getPrefix() + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!"); } - public static Boolean pluginNotFound(String pl, Integer spigotID) { + public static Boolean pluginNotFound(String pl, Integer spigotID, String ver) { if (Bukkit.getPluginManager().getPlugin(pl) == null) { plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); - Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: " + - "§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin."); - Main.plugin.getPluginLoader().disablePlugin(Main.plugin); - return true; - } else return false; - } - - public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) { - if (Bukkit.getPluginManager().getPlugin(pl) == null) { - plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); - Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: " + - "§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin."); + Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: " + + "§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin."); Main.plugin.getPluginLoader().disablePlugin(Main.plugin); return true; } else { - if (Double.parseDouble(Bukkit.getPluginManager().getPlugin(pl).getDescription().getVersion()) < ver) { + String plVer = Bukkit.getPluginManager().getPlugin(pl).getDescription().getVersion(); + if (ver.contains("_")) { + if (!plVer.equals(ver)) { + plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); + Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires the version §2" + + ver + " §4of §6" + pl + " §4Please use this version! Please download it here or contact us in Discord: §6https://spigotmc.org/resources/" + + pl + "." + spigotID + " Or contact us in Discord: http://dc.t2code.net"); + Main.plugin.getPluginLoader().disablePlugin(Main.plugin); + return true; + } + return false; + } + String[] split = plVer.split("_"); + if (Double.parseDouble(split[0]) < Double.parseDouble(ver)) { plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); - Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + "."); + Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + + " §4to use this version of " + plugin.getDescription().getName() + "."); Main.plugin.getPluginLoader().disablePlugin(Main.plugin); return true; } diff --git a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java index 8d96d14..d5c879d 100644 --- a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java +++ b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java @@ -136,18 +136,5 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter { return list; } - public static boolean hasPermission(CommandSender sender, String permission) { - - if (permission.equals("")) { - return true; - } - String[] Permissions = permission.split(";"); - for (String perm : Permissions) { - if (sender.hasPermission(perm)) { - return true; - } - } - return false; - } } diff --git a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/gui/OpenGUI.java b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/gui/OpenGUI.java index 28af3fe..dbaba0e 100644 --- a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/gui/OpenGUI.java +++ b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/gui/OpenGUI.java @@ -1,5 +1,6 @@ package de.jatitv.commandguiv2.Spigot.gui; +import de.jatitv.commandguiv2.Spigot.system.Permissions; import de.jatitv.commandguiv2.Spigot.useItem.Events; import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.objects.functions.Function; @@ -66,7 +67,7 @@ public class OpenGUI { if (MCVersion.minecraft1_13) { GUIListener.GUICode = ""; } else GUIListener.GUICode = "§6§8§9§r"; - if (gui.guiEnable || player.hasPermission("commandgui.bypass")) { + if (gui.guiEnable || player.hasPermission(Permissions.updatemsg)) { Inventory inventory; if (Main.PaPi) { inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (Replace.replace(prefix, player, GUIListener.GUICode + gui.guiName))); diff --git a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/listener/Bungee_Sender_Reciver.java b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/listener/Bungee_Sender_Reciver.java index b13e61c..879afe6 100644 --- a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/listener/Bungee_Sender_Reciver.java +++ b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/listener/Bungee_Sender_Reciver.java @@ -64,16 +64,4 @@ public class Bungee_Sender_Reciver implements PluginMessageListener { } } - public static void send(Player player, String server){ - ByteArrayOutputStream b = new ByteArrayOutputStream(); - DataOutputStream out = new DataOutputStream(b); - try { - out.writeUTF("Connect"); - out.writeUTF(server); - } catch (IOException i) { - i.printStackTrace(); - } - player.sendPluginMessage(Main.plugin, "BungeeCord", b.toByteArray()); - } - } diff --git a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Util.java b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Util.java index 8ed9411..205aa69 100644 --- a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Util.java +++ b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Util.java @@ -4,13 +4,13 @@ import net.t2code.lib.Spigot.system.T2CodeMain; public class Util { private static Integer configVersion = 5; - private static double requiredT2CodeLibVersion = 12.1; + private static String requiredT2CodeLibVersion = "12.1"; private static String Prefix = "§8[§4C§9GUI§8]"; private static Integer SpigotID = 90671; private static Integer BstatsID = 10840; private static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID; - public static double getRequiredT2CodeLibVersion() { + public static String getRequiredT2CodeLibVersion() { return requiredT2CodeLibVersion; }