Skip to content

Commit

Permalink
Error if loaded in even OLDER versions of Bukkit
Browse files Browse the repository at this point in the history
Take that, 1.8 servers.
  • Loading branch information
octylFractal committed Jul 12, 2020
1 parent f023b46 commit 22acd2b
Showing 1 changed file with 10 additions and 11 deletions.
Expand Up @@ -93,13 +93,21 @@
*/
public class WorldEditPlugin extends JavaPlugin implements TabCompleter {

private static final Logger log = LoggerFactory.getLogger(WorldEditPlugin.class);
public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui";
// This must be before the Logger is initialized, which fails in 1.8
private static final String FAILED_VERSION_CHECK =
"\n**********************************************\n"
+ "** This Minecraft version (%s) is not supported by this version of WorldEdit.\n"
+ "** Please download an OLDER version of WorldEdit which does.\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 final int BSTATS_PLUGIN_ID = 3328;

Expand Down Expand Up @@ -131,8 +139,6 @@ public void onLoad() {
*/
@Override
public void onEnable() {
checkForOldMinecraft();

PermissionsResolverManager.initialize(this); // Setup permission resolver

// Register CUI
Expand Down Expand Up @@ -166,13 +172,6 @@ public void onEnable() {
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() {
loadAdapter();
loadConfig();
Expand Down

0 comments on commit 22acd2b

Please sign in to comment.