package de.jatitv.commandguiv2.Spigot; //s bungeejoinplayers = new ArrayList<>(); public static File getPath() { return plugin.getDataFolder(); } private static Boolean enable = false; public static Boolean legacy = false; public static String version; public static List autor; public static Main plugin; public static Boolean PaPi = false; public static Boolean PlotSquaredGUI = false; public static Boolean LuckyBox = false; public static Boolean PlugManGUI = false; public static HashMap guiHashMap = new HashMap<>(); public static ArrayList allAliases = new ArrayList<>(); public static HashMap functionHashMap = new HashMap<>(); @Override public void onEnable() { // Plugin startup logic // Plugin startup logic Logger logger = this.getLogger(); plugin = this; autor = plugin.getDescription().getAuthors(); version = plugin.getDescription().getVersion(); if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12 || MCVersion.minecraft1_13 || MCVersion.minecraft1_14 || MCVersion.minecraft1_15 || NMSVersion.v1_16_R1) { legacy = true; } if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return; getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); if (PluginCheck.papi()) { PaPi = true; } Load.onLoad(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getSpigotID(), Util.getDiscord(), Util.getBstatsID()); enable = true; } public static void addonLoad() { if (PluginCheck.plotSquaredGUI()) { PlotSquaredGUI = true; addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI")); } if (PluginCheck.luckyBox()) { LuckyBox = true; addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox")); } if (PluginCheck.plugManGUI()) { PlugManGUI = true; addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI")); } } public static void addonEnable(Plugin plugin) { send.console(Util.getPrefix() + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!"); } public static Boolean pluginNotFound(String pl, Integer spigotID) { 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."); Main.plugin.getPluginLoader().disablePlugin(Main.plugin); return true; } else { if (Double.parseDouble(Bukkit.getPluginManager().getPlugin(pl).getDescription().getVersion()) < 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() + "."); Main.plugin.getPluginLoader().disablePlugin(Main.plugin); return true; } return false; } } public static void sendTryCatch(Class c, StackTraceElement line) { send.error(plugin, c.getName() + " Line: " + line.getLineNumber()); } @Override public void onDisable() { // Plugin shutdown logic if (enable) T2CodeTemplate.onDisable(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord()); MySQL.close(); } }