From b4a7556d9499f8e91082375d23b31f164cf94c0d Mon Sep 17 00:00:00 2001 From: Michal Kasprzykowski Date: Tue, 17 Dec 2024 12:36:06 +0100 Subject: [PATCH 1/3] Update item-nbt-api --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 4678fdf..2ef6340 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ dependencies { compileOnly "com.arcaniax:HeadDatabase-API:1.3.2" implementation "org.bstats:bstats-bukkit:3.0.2" - implementation "de.tr7zw:item-nbt-api:2.14.0" + implementation "de.tr7zw:item-nbt-api:2.14.1" implementation "com.github.cryptomorin:XSeries:10.0.0" compileOnly "org.projectlombok:lombok:1.18.34" From da830f2eb08c6fcdd1b0a6d96c335538b78cb21f Mon Sep 17 00:00:00 2001 From: Michal Kasprzykowski Date: Tue, 17 Dec 2024 12:36:40 +0100 Subject: [PATCH 2/3] Fix formatting --- .../holograms/api/nms/versions/NMS_1_17.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/decentsoftware/holograms/api/nms/versions/NMS_1_17.java b/src/main/java/eu/decentsoftware/holograms/api/nms/versions/NMS_1_17.java index 3514dc3..d7992bb 100644 --- a/src/main/java/eu/decentsoftware/holograms/api/nms/versions/NMS_1_17.java +++ b/src/main/java/eu/decentsoftware/holograms/api/nms/versions/NMS_1_17.java @@ -181,12 +181,12 @@ public class NMS_1_17 extends NMS { } // DATA WATCHER OBJECT if (Version.afterOrEqual(18)) { - if (Version.afterOrEqual(Version.v1_21_R2)) { - DWO_ENTITY_DATA = new ReflectField<>(ENTITY_CLASS, "am").getValue(null); - DWO_CUSTOM_NAME = new ReflectField<>(ENTITY_CLASS, "aO").getValue(null); - DWO_CUSTOM_NAME_VISIBLE = new ReflectField<>(ENTITY_CLASS, "aP").getValue(null); + if (Version.afterOrEqual(Version.v1_21_R2)) { + DWO_ENTITY_DATA = new ReflectField<>(ENTITY_CLASS, "am").getValue(null); + DWO_CUSTOM_NAME = new ReflectField<>(ENTITY_CLASS, "aO").getValue(null); + DWO_CUSTOM_NAME_VISIBLE = new ReflectField<>(ENTITY_CLASS, "aP").getValue(null); DWO_ARMOR_STAND_DATA = new ReflectField<>(ENTITY_ARMOR_STAND_CLASS, "bJ").getValue(null); - } else if (Version.afterOrEqual(Version.v1_21_R1)) { + } else if (Version.afterOrEqual(Version.v1_21_R1)) { DWO_ENTITY_DATA = new ReflectField<>(ENTITY_CLASS, "ap").getValue(null); DWO_CUSTOM_NAME = new ReflectField<>(ENTITY_CLASS, "aQ").getValue(null); DWO_CUSTOM_NAME_VISIBLE = new ReflectField<>(ENTITY_CLASS, "aR").getValue(null); From 1f37d5a56798eaae2c9a92267f594e641d4db096 Mon Sep 17 00:00:00 2001 From: Michal Kasprzykowski Date: Tue, 17 Dec 2024 12:39:04 +0100 Subject: [PATCH 3/3] 1.21.4 support --- .../holograms/api/nms/versions/NMS_1_17.java | 7 ++++++- .../holograms/api/utils/reflect/Version.java | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/decentsoftware/holograms/api/nms/versions/NMS_1_17.java b/src/main/java/eu/decentsoftware/holograms/api/nms/versions/NMS_1_17.java index d7992bb..850bd5a 100644 --- a/src/main/java/eu/decentsoftware/holograms/api/nms/versions/NMS_1_17.java +++ b/src/main/java/eu/decentsoftware/holograms/api/nms/versions/NMS_1_17.java @@ -181,7 +181,12 @@ public class NMS_1_17 extends NMS { } // DATA WATCHER OBJECT if (Version.afterOrEqual(18)) { - if (Version.afterOrEqual(Version.v1_21_R2)) { + if (Version.afterOrEqual(Version.v1_21_R3)) { + DWO_ENTITY_DATA = new ReflectField<>(ENTITY_CLASS, "am").getValue(null); + DWO_CUSTOM_NAME = new ReflectField<>(ENTITY_CLASS, "aO").getValue(null); + DWO_CUSTOM_NAME_VISIBLE = new ReflectField<>(ENTITY_CLASS, "aP").getValue(null); + DWO_ARMOR_STAND_DATA = new ReflectField<>(ENTITY_ARMOR_STAND_CLASS, "bI").getValue(null); + } else if (Version.afterOrEqual(Version.v1_21_R2)) { DWO_ENTITY_DATA = new ReflectField<>(ENTITY_CLASS, "am").getValue(null); DWO_CUSTOM_NAME = new ReflectField<>(ENTITY_CLASS, "aO").getValue(null); DWO_CUSTOM_NAME_VISIBLE = new ReflectField<>(ENTITY_CLASS, "aP").getValue(null); diff --git a/src/main/java/eu/decentsoftware/holograms/api/utils/reflect/Version.java b/src/main/java/eu/decentsoftware/holograms/api/utils/reflect/Version.java index 6e80bcf..5f48307 100644 --- a/src/main/java/eu/decentsoftware/holograms/api/utils/reflect/Version.java +++ b/src/main/java/eu/decentsoftware/holograms/api/utils/reflect/Version.java @@ -37,6 +37,7 @@ public enum Version { v1_20_R4(20, "1.20.5", "1.20.6"), v1_21_R1(21, "1.21", "1.21.1"), v1_21_R2(21, "1.21.2", "1.21.3"), + v1_21_R3(21, "1.21.4"), ; /*