3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01:00

Handle int tag for enchantment level

Dieser Commit ist enthalten in:
AJ Ferguson 2020-06-29 16:34:07 -08:00
Ursprung 7710261b70
Commit 95144266d2

Datei anzeigen

@ -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;
}