Skip to content

Commit

Permalink
Detect the server version using a long-standing API
Browse files Browse the repository at this point in the history
  • Loading branch information
Krakenied committed Sep 24, 2023
1 parent 15011f6 commit 157a13f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -275,7 +275,7 @@ public void onEnable() {
// Setup version specific compatibility layers
int version;
try {
version = Integer.parseInt(Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3].split("_")[1]);
version = Integer.parseInt(super.getServer().getBukkitVersion().split("\\.", 3)[1]);
} catch (ArrayIndexOutOfBoundsException | NumberFormatException e) {
questsLogger.warning("Failed to resolve server version - some features may not work!");
version = 0;
Expand Down

0 comments on commit 157a13f

Please sign in to comment.