add ability to configure active slots for the enchant

This commit is contained in:
2024-10-30 16:19:48 +01:00
parent 5ff3821cb3
commit 536c074439
10 changed files with 149 additions and 68 deletions
@@ -10,14 +10,17 @@ import net.kyori.adventure.text.Component;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.EquipmentSlotGroup;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.NotNull;
import java.util.Set;
@SuppressWarnings("UnstableApiUsage")
public interface EnchantioEnchant {
@NotNull
Key getKey();
@NotNull
Component getDescription();
int getAnvilCost();
@@ -26,20 +29,27 @@ public interface EnchantioEnchant {
int getWeight();
@NotNull
EnchantmentRegistryEntry.EnchantmentCost getMinimumCost();
@NotNull
EnchantmentRegistryEntry.EnchantmentCost getMaximumCost();
@NotNull
Iterable<EquipmentSlotGroup> getActiveSlots();
@NotNull
Set<TagEntry<ItemType>> getSupportedItems();
@NotNull
Set<TagKey<Enchantment>> getEnchantTagKeys();
@NotNull
default TagKey<ItemType> getTagForSupportedItems() {
return TagKey.create(RegistryKey.ITEM, Key.key( getKey().asString() + "_enchantable"));
}
@NotNull
default TagEntry<Enchantment> getTagEntry() {
return TagEntry.valueEntry(TypedKey.create(RegistryKey.ENCHANTMENT, getKey()));
}