Fixes NBTItem related deprecation warnings

This commit is contained in:
Christian Koop 2023-03-29 20:22:21 +02:00
parent a5e93331fd
commit 8f4a5b6644
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3

View File

@ -370,13 +370,13 @@ public class AnchorManager {
NBTItem nbtItem = new NBTItem(item);
if (nbtItem.hasKey(NBT_TICKS_KEY)) {
if (nbtItem.hasTag(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.hasKey("ticks")) {
if (nbtItem.hasTag("ticks")) {
int result = nbtItem.getInteger("ticks");
return result == -99 ? -1 : result;