diff --git a/api/src/main/java/io/github/liquip/api/item/Enchantment.java b/api/src/main/java/io/github/liquip/api/item/Enchantment.java index b76f5eb..77d1873 100644 --- a/api/src/main/java/io/github/liquip/api/item/Enchantment.java +++ b/api/src/main/java/io/github/liquip/api/item/Enchantment.java @@ -2,12 +2,16 @@ import net.kyori.adventure.key.Keyed; import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; +@ApiStatus.Experimental public interface Enchantment extends Keyed { - default void initialize(@NotNull Item item, int level) { + default int maxLevel() { + return 1; } - default void apply(@NotNull Item item, @NotNull ItemStack itemStack, int level) { + default boolean canApply(@NotNull ItemStack itemStack) { + return true; } } diff --git a/paper-core/src/main/java/io/github/liquip/paper/core/item/enchantment/BukkitEnchantment.java b/paper-core/src/main/java/io/github/liquip/paper/core/item/enchantment/BukkitEnchantment.java deleted file mode 100644 index ecd6e65..0000000 --- a/paper-core/src/main/java/io/github/liquip/paper/core/item/enchantment/BukkitEnchantment.java +++ /dev/null @@ -1,25 +0,0 @@ -package io.github.liquip.paper.core.item.enchantment; - -import io.github.liquip.api.item.Enchantment; -import io.github.liquip.api.item.Item; -import net.kyori.adventure.key.Key; -import org.bukkit.inventory.ItemStack; -import org.jetbrains.annotations.NotNull; - -public class BukkitEnchantment implements Enchantment { - private final org.bukkit.enchantments.Enchantment base; - - public BukkitEnchantment(org.bukkit.enchantments.Enchantment base) { - this.base = base; - } - - @Override - public @NotNull Key key() { - return this.base.key(); - } - - @Override - public void apply(@NotNull Item item, @NotNull ItemStack itemStack, int level) { - itemStack.addUnsafeEnchantment(this.base, level); - } -}