T2C-AutoResponse/src/main/java/net/t2code/autoresponse/Bungee/BMain.java

41 lines
1.6 KiB
Java

package net.t2code.autoresponse.Bungee;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.plugin.Plugin;
import net.t2code.autoresponse.Bungee.system.BLoad;
import net.t2code.autoresponse.Util;
import net.t2code.lib.Bungee.Lib.messages.BT2CodeTemplate;
import java.util.logging.Level;
public final class BMain extends Plugin {
private static Plugin plugin;
private static String version;
private static String autor;
@Override
public void onEnable() {
// Plugin startup logic
plugin = this;
version = plugin.getDescription().getVersion();
autor = plugin.getDescription().getAuthor();
if (ProxyServer.getInstance().getPluginManager().getPlugin("T2CodeLib") == null) {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
ProxyServer.getInstance().getConsole().sendMessage(Util.getPrefix() + " §eT2CodeLib §4could not be found. Please download it here: " +
"§6https://www.spigotmc.org/resources/t2codelib.96388/ §4to be able to use this plugin.");
getProxy().getPluginManager().getPlugin(plugin.getDescription().getName()).onDisable();
return;
}
BLoad.onLoad(plugin, Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord(), Util.getSpigotID(), Util.getBstatsID());
}
@Override
public void onDisable() {
// Plugin shutdown logic
if (ProxyServer.getInstance().getPluginManager().getPlugin("T2CodeLib") == null) return;
BT2CodeTemplate.onDisable(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
}
}