forked from GeyserMC/Geyser
Handle int tag for enchantment level
This commit is contained in:
parent
7710261b70
commit
95144266d2
1 changed files with 2 additions and 2 deletions
|
@ -122,7 +122,7 @@ public class EnchantmentTranslator extends NbtItemStackTranslator {
|
|||
|
||||
private CompoundTag remapEnchantment(CompoundTag tag) {
|
||||
Tag javaEnchLvl = tag.get("lvl");
|
||||
if (!(javaEnchLvl instanceof ShortTag))
|
||||
if (!(javaEnchLvl instanceof ShortTag || javaEnchLvl instanceof IntTag))
|
||||
return null;
|
||||
|
||||
Tag javaEnchId = tag.get("id");
|
||||
|
@ -137,7 +137,7 @@ public class EnchantmentTranslator extends NbtItemStackTranslator {
|
|||
|
||||
CompoundTag bedrockTag = new CompoundTag("");
|
||||
bedrockTag.put(new ShortTag("id", (short) enchantment.ordinal()));
|
||||
bedrockTag.put(new ShortTag("lvl", ((ShortTag) javaEnchLvl).getValue()));
|
||||
bedrockTag.put(new ShortTag("lvl", ((Number) javaEnchLvl.getValue()).shortValue()));
|
||||
return bedrockTag;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue