Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit 9333bf2

Browse files
committed
Add better incompatible version warning essage
1 parent 2a21e89 commit 9333bf2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/main/java/ru/tehkode/permissions/bukkit/PermissionsEx.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.logging.Level;
2626
import java.util.logging.LogRecord;
2727

28+
import com.google.common.cache.CacheBuilder;
2829
import com.zachsthings.netevents.NetEventsPlugin;
2930
import net.gravitydevelopment.updater.Updater;
3031
import org.bukkit.ChatColor;
@@ -160,19 +161,30 @@ public void onEnable() {
160161
return;
161162
}
162163
try {
164+
try {
165+
CacheBuilder.class.getMethod("maximumSize", long.class);
166+
} catch (NoSuchMethodException e) {
167+
getLogger().severe("=================================================================================");
168+
getLogger().severe("As of version 1.23, PEX is only compatible with versions of Minecraft 1.8 or greater. " +
169+
"Please downgrade to the most recent 1.22.x series version of PEX to continue.");
170+
getLogger().severe("=================================================================================");
171+
getPluginLoader().disablePlugin(this);
172+
return;
173+
}
174+
163175
if (this.permissionsManager == null) {
164176
this.permissionsManager = new PermissionManager(config, getLogger(), this);
165177
}
166178

167179
try {
168180
OfflinePlayer.class.getMethod("getUniqueId");
169181
} catch (NoSuchMethodException e) {
170-
getLogger().severe("============================================================================================");
182+
getLogger().severe("=================================================================================");
171183
getLogger().severe("As of version 1.21, PEX requires a version of Bukkit with UUID support to function (>1.7.5). Please download a non-UUID version of PermissionsEx to continue.");
172184
getLogger().severe("Beginning reversion of potential invalid UUID conversion");
173185
getPermissionsManager().getBackend().revertUUID();
174186
getLogger().severe("Reversion complete, disabling. PermissionsEx will not work until downgrade is complete");
175-
getLogger().severe("============================================================================================");
187+
getLogger().severe("=================================================================================");
176188
getPluginLoader().disablePlugin(this);
177189
return;
178190
}

0 commit comments

Comments
 (0)