From 0675ec8333a51d974a0bf99e729f2a7befd6e974 Mon Sep 17 00:00:00 2001 From: xGinko Date: Sat, 17 Aug 2024 02:48:58 +0200 Subject: [PATCH] fix display of wrong jar version error --- .../me/xginko/aef/AnarchyExploitFixes.java | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/AnarchyExploitFixes.java b/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/AnarchyExploitFixes.java index c3da0514..b7405b59 100755 --- a/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/AnarchyExploitFixes.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/AnarchyExploitFixes.java @@ -54,8 +54,6 @@ public final class AnarchyExploitFixes extends JavaPlugin { @Override public void onLoad() { PlatformUtil.load(); - prefixedLogger = ComponentLogger.logger(getLogger().getName()); - unPrefixedLogger = ComponentLogger.logger(""); // Disable logging for some shaded libraries as those can get very verbose String shadedLibs = getClass().getPackageName() + ".libs"; Configurator.setLevel(shadedLibs + ".reflections.Reflections", Level.OFF); @@ -70,6 +68,22 @@ public void onLoad() { @Override public void onEnable() { + if (!PlatformUtil.isPaper()) { + getLogger().severe("This plugin depends on Paper's API, which is not present on your server."); + getServer().getPluginManager().disablePlugin(this); + return; + } + + if (PlatformUtil.getMinecraftVersion() < 19) { + getLogger().severe("The Folia jar is intended for Paper and Folia servers running 1.19 and above."); + getLogger().severe("Please replace it with the Legacy jar."); + getServer().getPluginManager().disablePlugin(this); + return; + } + + prefixedLogger = ComponentLogger.logger(getLogger().getName()); + unPrefixedLogger = ComponentLogger.logger(""); + if (!isPacketEventsInstalled) { Stream.of(" ", " _ _ _ _ _ ", @@ -104,21 +118,8 @@ public void onEnable() { " " ).map(str -> Component.text(str).color(KyoriUtil.AEF_WHITE)).forEach(prefixedLogger::info); - if (!PlatformUtil.isPaper()) { - prefixedLogger.error("This plugin depends on Paper's API, which is not present on your server."); - getServer().getPluginManager().disablePlugin(this); - return; - } - prefixedLogger.info("Detected Version 1.{}.{}", PlatformUtil.getMinecraftVersion(), PlatformUtil.getMinecraftPatchVersion()); - if (PlatformUtil.getMinecraftVersion() < 19) { - prefixedLogger.error("The Folia jar is intended for Paper and Folia servers running 1.19 and above."); - prefixedLogger.error("Please replace it with the Legacy jar."); - getServer().getPluginManager().disablePlugin(this); - return; - } - if (PlatformUtil.isFolia()) { prefixedLogger.info("Detected Folia server."); }