mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-19 15:09:26 +00:00
fix: item serializer not putting enchants on properly due to uppercase value
This commit is contained in:
@@ -102,8 +102,11 @@ public class ItemSerializer implements TypeSerializer<ItemStack> {
|
||||
|
||||
if (!enchantsNode.virtual()) {
|
||||
for (ConfigurationNode enchantNode : enchantsNode.childrenMap().values()) {
|
||||
if (Enchantment.getByKey(NamespacedKey.minecraft(enchantNode.key().toString())) == null) continue;
|
||||
itemMeta.addEnchant(Enchantment.getByKey(NamespacedKey.minecraft(enchantNode.key().toString())), enchantNode.getInt(1), true);
|
||||
String enchantName = enchantNode.key().toString().toLowerCase();
|
||||
NamespacedKey key = NamespacedKey.minecraft(enchantName);
|
||||
Enchantment enchant = Enchantment.getByKey(key);
|
||||
if (enchant == null) continue;
|
||||
itemMeta.addEnchant(enchant, enchantNode.getInt(1), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user