From 6395dd196426ad5512fd264ea42a86c2b8b0121a Mon Sep 17 00:00:00 2001 From: tr7zw Date: Tue, 23 Apr 2024 23:04:15 +0200 Subject: [PATCH] Disable invalid tests for 1.20.5+ --- .../changeme/nbtapi/utils/nmsmappings/ObjectCreator.java | 2 +- .../java/de/tr7zw/nbtapi/plugin/tests/items/MetaTest.java | 4 ++++ .../de/tr7zw/nbtapi/plugin/tests/proxy/DataItemProxyTest.java | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/nmsmappings/ObjectCreator.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/nmsmappings/ObjectCreator.java index 89a4fdfdd..86ca66f14 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/nmsmappings/ObjectCreator.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/nmsmappings/ObjectCreator.java @@ -19,7 +19,7 @@ public enum ObjectCreator { NMS_NBTTAGCOMPOUND(null, null, ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()), NMS_CUSTOMDATA(MinecraftVersion.MC1_20_R4, null, ClassWrapper.NMS_CUSTOMDATA.getClazz(), ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()), NMS_BLOCKPOSITION(null, null, ClassWrapper.NMS_BLOCKPOSITION.getClazz(), int.class, int.class, int.class), - NMS_COMPOUNDFROMITEM(MinecraftVersion.MC1_11_R1, null, ClassWrapper.NMS_ITEMSTACK.getClazz(), + NMS_COMPOUNDFROMITEM(MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_20_R3, ClassWrapper.NMS_ITEMSTACK.getClazz(), ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz()),; private Constructor construct; diff --git a/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/items/MetaTest.java b/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/items/MetaTest.java index 00f3620e2..92980b370 100644 --- a/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/items/MetaTest.java +++ b/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/items/MetaTest.java @@ -6,12 +6,16 @@ import de.tr7zw.changeme.nbtapi.NBT; import de.tr7zw.changeme.nbtapi.NbtApiException; +import de.tr7zw.changeme.nbtapi.utils.MinecraftVersion; import de.tr7zw.nbtapi.plugin.tests.Test; public class MetaTest implements Test { @Override public void test() throws Exception { + if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_20_R4)) { + return; // skip + } ItemStack item = new ItemStack(Material.STONE); NBT.modify(item, nbt -> { nbt.setInteger("HideFlags", 1); diff --git a/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/proxy/DataItemProxyTest.java b/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/proxy/DataItemProxyTest.java index b1d2132b6..f8520e6a2 100644 --- a/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/proxy/DataItemProxyTest.java +++ b/item-nbt-plugin/src/main/java/de/tr7zw/nbtapi/plugin/tests/proxy/DataItemProxyTest.java @@ -16,6 +16,9 @@ public class DataItemProxyTest implements Test { @Override public void test() throws Exception { + if(MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_20_R4)) { + return; // skip + } ItemStack item = new ItemStack(Material.STONE); ItemMeta meta = item.getItemMeta(); meta.setDisplayName("Test");