NounsPicker/src/main/java/wtf/beatrice/nounspicker/NounsPicker.java

41 lines
1.1 KiB
Java
Raw Normal View History

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