From e8cdcd4bd75e4385f335319104380cf7884f4d61 Mon Sep 17 00:00:00 2001 From: CanardNocturne Date: Wed, 18 Oct 2023 18:37:16 +0200 Subject: [PATCH 1/2] the enchantment id is a String but it was got as a short --- .../java/org/spongepowered/common/item/SpongeItemStack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/spongepowered/common/item/SpongeItemStack.java b/src/main/java/org/spongepowered/common/item/SpongeItemStack.java index 8e2f0b58c30..3a552f29c7f 100644 --- a/src/main/java/org/spongepowered/common/item/SpongeItemStack.java +++ b/src/main/java/org/spongepowered/common/item/SpongeItemStack.java @@ -356,10 +356,10 @@ public static void fixEnchantmentData(final ItemType itemType, final CompoundTag for (int i = 0; i < nbttaglist.size(); ++i) { final CompoundTag nbttagcompound = nbttaglist.getCompound(i); - final short id = nbttagcompound.getShort(Constants.Item.ITEM_ENCHANTMENT_ID); + final String id = nbttagcompound.getString(Constants.Item.ITEM_ENCHANTMENT_ID); final short lvl = nbttagcompound.getShort(Constants.Item.ITEM_ENCHANTMENT_LEVEL); - nbttagcompound.putShort(Constants.Item.ITEM_ENCHANTMENT_ID, id); + nbttagcompound.putString(Constants.Item.ITEM_ENCHANTMENT_ID, id); nbttagcompound.putShort(Constants.Item.ITEM_ENCHANTMENT_LEVEL, lvl); } } From cce154c8f372e90d64ba36dffdca5bb869e1f296 Mon Sep 17 00:00:00 2001 From: CanardNocturne Date: Sun, 5 Nov 2023 14:22:41 +0100 Subject: [PATCH 2/2] remove getting and setting the id --- .../java/org/spongepowered/common/item/SpongeItemStack.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/org/spongepowered/common/item/SpongeItemStack.java b/src/main/java/org/spongepowered/common/item/SpongeItemStack.java index 3a552f29c7f..09f89cb9756 100644 --- a/src/main/java/org/spongepowered/common/item/SpongeItemStack.java +++ b/src/main/java/org/spongepowered/common/item/SpongeItemStack.java @@ -356,10 +356,8 @@ public static void fixEnchantmentData(final ItemType itemType, final CompoundTag for (int i = 0; i < nbttaglist.size(); ++i) { final CompoundTag nbttagcompound = nbttaglist.getCompound(i); - final String id = nbttagcompound.getString(Constants.Item.ITEM_ENCHANTMENT_ID); final short lvl = nbttagcompound.getShort(Constants.Item.ITEM_ENCHANTMENT_LEVEL); - nbttagcompound.putString(Constants.Item.ITEM_ENCHANTMENT_ID, id); nbttagcompound.putShort(Constants.Item.ITEM_ENCHANTMENT_LEVEL, lvl); } }