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
@@ -9,6 +9,7 @@ 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.Collections;
import java.util.HashSet;
@@ -44,12 +45,12 @@ public class ReplantingEnchant implements EnchantioEnchant {
}
@Override
public Key getKey() {
public @NotNull Key getKey() {
return KEY;
}
@Override
public Component getDescription() {
public @NotNull Component getDescription() {
return Component.translatable("enchantio.enchant.replanting", "Replanting");
}
@@ -69,27 +70,27 @@ public class ReplantingEnchant implements EnchantioEnchant {
}
@Override
public EnchantmentRegistryEntry.EnchantmentCost getMinimumCost() {
public EnchantmentRegistryEntry.@NotNull EnchantmentCost getMinimumCost() {
return minimumCost;
}
@Override
public EnchantmentRegistryEntry.EnchantmentCost getMaximumCost() {
public EnchantmentRegistryEntry.@NotNull EnchantmentCost getMaximumCost() {
return maximumCost;
}
@Override
public Iterable<EquipmentSlotGroup> getActiveSlots() {
return Set.of(EquipmentSlotGroup.HAND);
public @NotNull Iterable<EquipmentSlotGroup> getActiveSlots() {
return Set.of(EquipmentSlotGroup.MAINHAND);
}
@Override
public Set<TagEntry<ItemType>> getSupportedItems() {
public @NotNull Set<TagEntry<ItemType>> getSupportedItems() {
return supportedItemTags;
}
@Override
public Set<TagKey<Enchantment>> getEnchantTagKeys() {
public @NotNull Set<TagKey<Enchantment>> getEnchantTagKeys() {
return Collections.unmodifiableSet(enchantTagKeys);
}