refactor to allow adding enchants to arbitrary tags

This commit is contained in:
2024-10-28 16:01:51 +01:00
parent deb4d0d67a
commit 3752a9e31a
8 changed files with 93 additions and 89 deletions
@@ -32,12 +32,14 @@ public interface EnchantioEnchant {
Iterable<EquipmentSlotGroup> getActiveSlots();
boolean canGetFromEnchantingTable();
TagKey<ItemType> getTagForSupportedItems();
Set<TagEntry<ItemType>> getSupportedItems();
Set<TagKey<Enchantment>> getEnchantTagKeys();
default TagKey<ItemType> getTagForSupportedItems() {
return TagKey.create(RegistryKey.ITEM, Key.key( getKey().asString() + "_enchantable"));
}
default TagEntry<Enchantment> getTagEntry() {
return TagEntry.valueEntry(TypedKey.create(RegistryKey.ENCHANTMENT, getKey()));
}