Fix enchantments on books Bedrock -> Java (#3713)

This commit is contained in:
onebeastchris 2023-04-28 22:29:46 +02:00 committed by GitHub
parent 8a25afbc8f
commit baae46822e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -197,10 +197,14 @@ public class Item {
} }
} }
if (!enchantments.isEmpty()) { if (!enchantments.isEmpty()) {
if ((this instanceof EnchantedBookItem)) {
tag.put(new ListTag("StoredEnchantments", enchantments));
} else {
tag.put(new ListTag("Enchantments", enchantments)); tag.put(new ListTag("Enchantments", enchantments));
} }
} }
} }
}
protected final CompoundTag remapEnchantment(GeyserSession session, CompoundTag tag, CompoundTag rootTag) { protected final CompoundTag remapEnchantment(GeyserSession session, CompoundTag tag, CompoundTag rootTag) {
Tag javaEnchId = tag.get("id"); Tag javaEnchId = tag.get("id");