2022-10-21 12:47:14 +02:00
|
|
|
package wtf.beatrice.nounspicker;
|
|
|
|
|
2022-10-21 23:58:52 +02:00
|
|
|
import org.bukkit.Bukkit;
|
2022-10-21 12:57:41 +02:00
|
|
|
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;
|
2022-10-21 12:57:41 +02:00
|
|
|
|
|
|
|
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;
|
2022-10-21 12:57:41 +02:00
|
|
|
private PluginManager pluginManager;
|
2022-10-22 00:14:33 +02:00
|
|
|
private final ConsoleLogger logger = new ConsoleLogger(getClass());
|
2022-10-21 12:57:41 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onEnable()
|
2022-10-21 12:47:14 +02:00
|
|
|
{
|
2022-10-22 00:14:33 +02:00
|
|
|
logger.log("Loading plugin!");
|
|
|
|
|
2022-10-21 12:57:41 +02:00
|
|
|
pluginManager = getServer().getPluginManager();
|
2022-10-21 23:58:52 +02:00
|
|
|
instance = this;
|
2022-10-21 12:57:41 +02:00
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|