mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-01-26 09:21:22 +01:00
parent
070c7f5808
commit
1251d43709
@ -329,9 +329,10 @@ public class InventoryPackets {
|
|||||||
ListTag ench = tag.get("ench");
|
ListTag ench = tag.get("ench");
|
||||||
ListTag enchantments = new ListTag(CompoundTag.class);
|
ListTag enchantments = new ListTag(CompoundTag.class);
|
||||||
for (Tag enchEntry : ench) {
|
for (Tag enchEntry : ench) {
|
||||||
if (enchEntry instanceof CompoundTag) {
|
NumberTag idTag;
|
||||||
|
if (enchEntry instanceof CompoundTag && (idTag = ((CompoundTag) enchEntry).get("id")) != null) {
|
||||||
CompoundTag enchantmentEntry = new CompoundTag();
|
CompoundTag enchantmentEntry = new CompoundTag();
|
||||||
short oldId = ((NumberTag) ((CompoundTag) enchEntry).get("id")).asShort();
|
short oldId = idTag.asShort();
|
||||||
String newId = Protocol1_13To1_12_2.MAPPINGS.getOldEnchantmentsIds().get(oldId);
|
String newId = Protocol1_13To1_12_2.MAPPINGS.getOldEnchantmentsIds().get(oldId);
|
||||||
if (newId == null) {
|
if (newId == null) {
|
||||||
newId = "viaversion:legacy/" + oldId;
|
newId = "viaversion:legacy/" + oldId;
|
||||||
|
Loading…
Reference in New Issue
Block a user