package wtf.beatrice.nounspicker; import org.bukkit.Bukkit; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import wtf.beatrice.nounspicker.objects.PAPIManager; import wtf.beatrice.nounspicker.utils.ConsoleLogger; public class NounsPicker extends JavaPlugin { private static NounsPicker instance; private PluginManager pluginManager; private final ConsoleLogger logger = new ConsoleLogger(getClass()); @Override public void onEnable() { logger.log("Loading plugin!"); pluginManager = getServer().getPluginManager(); instance = this; // register PlaceholderAPI if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { new PAPIManager(this).register(); logger.log("PlaceholderAPI integration loaded!"); } else { logger.err("Missing PlaceholderAPI! The plugin cannot continue."); pluginManager.disablePlugin(this); return; } logger.log("Plugin loaded!"); } public static NounsPicker getInstance() { return instance; } }