From 97cfb1cfc75e6af320946bac05ceccb50fa689ff Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 3 Jun 2021 14:23:19 -0700 Subject: [PATCH] More 1.17 support --- .../com/gmail/nossr50/util/compat/CompatibilityManager.java | 5 ++++- src/main/java/com/gmail/nossr50/util/nms/NMSVersion.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/util/compat/CompatibilityManager.java b/src/main/java/com/gmail/nossr50/util/compat/CompatibilityManager.java index 1b78a55df..13d05ea1f 100644 --- a/src/main/java/com/gmail/nossr50/util/compat/CompatibilityManager.java +++ b/src/main/java/com/gmail/nossr50/util/compat/CompatibilityManager.java @@ -77,7 +77,8 @@ public class CompatibilityManager { } private void initWorldCompatibilityLayer() { - if((minecraftGameVersion.getMinorVersion().asInt() >= 16 && minecraftGameVersion.getPatchVersion().asInt() >= 4) + if(minecraftGameVersion.getMinorVersion().asInt() > 17 + || (minecraftGameVersion.getMinorVersion().asInt() >= 16 && minecraftGameVersion.getPatchVersion().asInt() >= 4) || minecraftGameVersion.getMajorVersion().asInt() >= 2) { if(hasNewWorldMinHeightAPI()) { worldCompatibilityLayer = new WorldCompatibilityLayer_1_16_4(); @@ -213,6 +214,8 @@ public class CompatibilityManager { } else if(minecraftGameVersion.getPatchVersion().asInt() >= 5) { return NMSVersion.NMS_1_16_5; } + case 17: + return NMSVersion.NMS_1_17; } } diff --git a/src/main/java/com/gmail/nossr50/util/nms/NMSVersion.java b/src/main/java/com/gmail/nossr50/util/nms/NMSVersion.java index 4b2ce5c57..8c1e3c8b4 100644 --- a/src/main/java/com/gmail/nossr50/util/nms/NMSVersion.java +++ b/src/main/java/com/gmail/nossr50/util/nms/NMSVersion.java @@ -22,6 +22,7 @@ public enum NMSVersion { NMS_1_16_3("1.16.3"), NMS_1_16_4("1.16.4"), NMS_1_16_5("1.16.5"), + NMS_1_17("1.17"), //Version not known to this build of mcMMO UNSUPPORTED("unsupported");