69 lines
2.1 KiB
Java
69 lines
2.1 KiB
Java
package pku.yim.magicgem;
|
|
|
|
import cn.infstar.magicgem.MagicGemPlugin;
|
|
import cn.infstar.magicgem.config.PluginSettings;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
/** Compatibility base class retained for plugins compiled against the original MagicGem API. */
|
|
public class MagicGem extends MagicGemPlugin {
|
|
public static MagicGem instance;
|
|
public static boolean placeholderapi;
|
|
public static boolean MMCorMMA;
|
|
public static boolean isArtifact;
|
|
public static boolean workbench;
|
|
public static boolean backpack;
|
|
public static boolean gemLore;
|
|
public static boolean gemCraft;
|
|
public static boolean skillEngine;
|
|
|
|
public static MagicGem getInstance() {
|
|
return instance;
|
|
}
|
|
|
|
@Override
|
|
public void onEnable() {
|
|
instance = this;
|
|
super.onEnable();
|
|
}
|
|
|
|
@Override
|
|
public void onDisable() {
|
|
try {
|
|
super.onDisable();
|
|
} finally {
|
|
if (instance == this) instance = null;
|
|
}
|
|
}
|
|
|
|
@Override
|
|
protected void onSettingsReloaded(PluginSettings settings) {
|
|
placeholderapi = getServer().getPluginManager().getPlugin("PlaceholderAPI") != null;
|
|
MMCorMMA = getServer().getPluginManager().getPlugin("MythicMobs") != null;
|
|
isArtifact = getServer().getPluginManager().getPlugin("MythicArtifacts") != null
|
|
|| getServer().getPluginManager().getPlugin("MythicCrucible") != null;
|
|
workbench = settings.workbench();
|
|
backpack = settings.backpack();
|
|
gemLore = settings.gemLore();
|
|
gemCraft = settings.gemCraft();
|
|
skillEngine = settings.skillEngine();
|
|
}
|
|
|
|
public void info(String message) {
|
|
getLogger().info(message);
|
|
}
|
|
|
|
public void disablePlugin() {
|
|
getServer().getPluginManager().disablePlugin(this);
|
|
}
|
|
|
|
public boolean isPrimaryThread() {
|
|
return Bukkit.isPrimaryThread();
|
|
}
|
|
|
|
/** Network license activation belonged to the retired vendor service. */
|
|
public void license(CommandSender sender) {
|
|
sender.sendMessage("MagicGem license service is not configured in this build.");
|
|
}
|
|
}
|