Document MagicGem migration workflow
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
package pku.yim.magicgem;
|
||||
|
||||
import cn.infstar.cmagicgem.CMagicGem;
|
||||
import cn.infstar.cmagicgem.config.PluginSettings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
/** Legacy entry point retained for plugins that resolve MagicGem by class name. */
|
||||
public final class MagicGem extends CMagicGem {
|
||||
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.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user