From a9480d0b5b44789068f27c988f3257e64bfaa6a4 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sun, 30 Jan 2022 20:10:38 +0100 Subject: [PATCH 1/4] Updates SongodaCore to v2.6.11 The resulting EpicAnchors jar is unaffected by this upgrade, no release needed --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 505e316..87975a4 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.songoda SongodaCore - 2.6.10 + 2.6.11 compile From 421b4a5056f6c0b00245ce9fd3f25fb3a9cf5f3c Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Fri, 18 Mar 2022 18:06:00 +0100 Subject: [PATCH 2/4] Updates Core to v2.6.12 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 87975a4..0b61641 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.songoda SongodaCore - 2.6.11 + 2.6.12 compile From b615dd452ad1db85bd184b843f0afcee7d3978c5 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Fri, 18 Mar 2022 18:06:22 +0100 Subject: [PATCH 3/4] Replaces deprecated NBTItem implementation --- .../songoda/epicanchors/AnchorManager.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/songoda/epicanchors/AnchorManager.java b/src/main/java/com/songoda/epicanchors/AnchorManager.java index 13b2998..c02556c 100644 --- a/src/main/java/com/songoda/epicanchors/AnchorManager.java +++ b/src/main/java/com/songoda/epicanchors/AnchorManager.java @@ -5,8 +5,7 @@ import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.core.compatibility.CompatibleParticleHandler; import com.songoda.core.compatibility.CompatibleSound; import com.songoda.core.hooks.HologramManager; -import com.songoda.core.nms.NmsManager; -import com.songoda.core.nms.nbt.NBTItem; +import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.songoda.core.utils.TextUtils; import com.songoda.core.utils.TimeUtils; import com.songoda.epicanchors.api.AnchorAccessCheck; @@ -358,24 +357,27 @@ public class AnchorManager { meta.setLore(TextUtils.formatText(Settings.LORE.getString().split("\r?\n"))); item.setItemMeta(meta); - NBTItem nbtItem = NmsManager.getNbt().of(item); - nbtItem.set(NBT_TICKS_KEY, ticks); + NBTItem nbtItem = new NBTItem(item); + nbtItem.setInteger(NBT_TICKS_KEY, ticks); - return nbtItem.finish(); + return nbtItem.getItem(); } public static int getTicksFromItem(ItemStack item) { - NBTItem nbtItem = NmsManager.getNbt().of(item); + if (item == null || item.getType() == Material.AIR) { + return 0; + } - if (nbtItem.has(NBT_TICKS_KEY)) { - return nbtItem.getInt(NBT_TICKS_KEY); + NBTItem nbtItem = new NBTItem(item); + + if (nbtItem.hasKey(NBT_TICKS_KEY)) { + return nbtItem.getInteger(NBT_TICKS_KEY); } // Legacy code (pre v2) to stay cross-version compatible if (Settings.MATERIAL.getMaterial().getMaterial() == item.getType()) { - - if (nbtItem.has("ticks")) { - int result = nbtItem.getInt("ticks"); + if (nbtItem.hasKey("ticks")) { + int result = nbtItem.getInteger("ticks"); return result == -99 ? -1 : result; } From 958b6fd1a8a9abaaa7b5e9cf27bda021604cf6dc Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Fri, 18 Mar 2022 18:06:38 +0100 Subject: [PATCH 4/4] Release v2.2.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0b61641..6445f85 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.songoda EpicAnchors - 2.2.0 + 2.2.1 EpicAnchors Allow your players to keep chunks loaded for a limited amount of time for a cost.