Skip to content

Commit

Permalink
Fix lib version detection (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelien30000 authored Oct 26, 2024
1 parent 3a23bd6 commit 4c0150a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public CrossVersion() {
}

public static String getVersion() {
return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
return Bukkit.getBukkitVersion().split("-")[0];
}

public ItemStack addNBTTag(ItemStack stack, String key, Object value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public enum MaterialProxy {

public ItemStack crossVersion() {
String version = CrossVersion.getVersion();
if ("v1_12_R1".equals(version)) {
return getLegacy();
if (version.startsWith("1.12")) {
getLegacy();
}
return getLatest();
}
Expand Down

0 comments on commit 4c0150a

Please sign in to comment.