Fix enchantment parsing or lvl integers

This commit is contained in:
KennyTV 2021-05-21 09:17:40 +02:00
parent 1fe76dbb77
commit ab1cc791b7
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
1 changed files with 2 additions and 2 deletions

View File

@ -595,7 +595,7 @@ public class InventoryPackets {
}
if (oldId != null) {
enchEntry.put("id", new ShortTag(oldId));
enchEntry.put("lvl", new ShortTag((Short) ((CompoundTag) enchantmentEntry).get("lvl").getValue()));
enchEntry.put("lvl", new ShortTag(((NumberTag) ((CompoundTag) enchantmentEntry).get("lvl")).asShort()));
ench.add(enchEntry);
}
}
@ -616,7 +616,7 @@ public class InventoryPackets {
}
if (oldId != null) {
enchEntry.put("id", new ShortTag(oldId));
enchEntry.put("lvl", new ShortTag((Short) ((CompoundTag) enchantmentEntry).get("lvl").getValue()));
enchEntry.put("lvl", new ShortTag(((NumberTag) ((CompoundTag) enchantmentEntry).get("lvl")).asShort()));
newStoredEnch.add(enchEntry);
}
}