Error if loaded in even OLDER versions of Bukkit

Take that, 1.8 servers.
This commit is contained in:
Octavia Togami 2020-07-11 19:29:50 -07:00
parent f023b46fae
commit 22acd2b486
No known key found for this signature in database
GPG Key ID: CC364524D1983C99

View File

@ -93,13 +93,21 @@
*/ */
public class WorldEditPlugin extends JavaPlugin implements TabCompleter { public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
private static final Logger log = LoggerFactory.getLogger(WorldEditPlugin.class); // This must be before the Logger is initialized, which fails in 1.8
public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui";
private static final String FAILED_VERSION_CHECK = private static final String FAILED_VERSION_CHECK =
"\n**********************************************\n" "\n**********************************************\n"
+ "** This Minecraft version (%s) is not supported by this version of WorldEdit.\n" + "** This Minecraft version (%s) is not supported by this version of WorldEdit.\n"
+ "** Please download an OLDER version of WorldEdit which does.\n" + "** Please download an OLDER version of WorldEdit which does.\n"
+ "**********************************************\n"; + "**********************************************\n";
static {
if (PaperLib.getMinecraftVersion() < 13) {
throw new IllegalStateException(String.format(FAILED_VERSION_CHECK, Bukkit.getVersion()));
}
}
private static final Logger log = LoggerFactory.getLogger(WorldEditPlugin.class);
public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui";
private static WorldEditPlugin INSTANCE; private static WorldEditPlugin INSTANCE;
private static final int BSTATS_PLUGIN_ID = 3328; private static final int BSTATS_PLUGIN_ID = 3328;
@ -131,8 +139,6 @@ public void onLoad() {
*/ */
@Override @Override
public void onEnable() { public void onEnable() {
checkForOldMinecraft();
PermissionsResolverManager.initialize(this); // Setup permission resolver PermissionsResolverManager.initialize(this); // Setup permission resolver
// Register CUI // Register CUI
@ -166,13 +172,6 @@ public void onEnable() {
PaperLib.suggestPaper(this); PaperLib.suggestPaper(this);
} }
private void checkForOldMinecraft() {
if (PaperLib.getMinecraftVersion() < 13) {
Bukkit.getPluginManager().disablePlugin(this);
throw new IllegalStateException(String.format(FAILED_VERSION_CHECK, Bukkit.getVersion()));
}
}
private void setupPreWorldData() { private void setupPreWorldData() {
loadAdapter(); loadAdapter();
loadConfig(); loadConfig();