mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-22 12:16:21 +01:00
parent
c2ae3df1db
commit
9da206e280
@ -653,10 +653,17 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
|
||||
for (Tag enchantmentEntryTag : enchantments.clone()) {
|
||||
CompoundTag enchantmentEntry = (CompoundTag) enchantmentEntryTag;
|
||||
Tag idTag = enchantmentEntry.get("id");
|
||||
if (!(idTag instanceof StringTag)) continue;
|
||||
if (!(idTag instanceof StringTag)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String newId = (String) idTag.getValue();
|
||||
int levelValue = ((NumberTag) enchantmentEntry.get("lvl")).asInt();
|
||||
NumberTag levelTag = enchantmentEntry.get("lvl");
|
||||
if (levelTag == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int levelValue = levelTag.asInt();
|
||||
short level = levelValue < Short.MAX_VALUE ? (short) levelValue : Short.MAX_VALUE;
|
||||
|
||||
String mappedEnchantmentId = enchantmentMappings.get(newId);
|
||||
|
Loading…
Reference in New Issue
Block a user