From e42e97a8c4d78734afa3e4fc80f556e88ce6d91c Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Wed, 15 Sep 2021 23:14:10 +0200 Subject: [PATCH] Add custom enchantment for tracking landmines --- .../spigot/landmines2/LandmineEnchantment.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/main/kotlin/dev/w1zzrd/spigot/landmines2/LandmineEnchantment.kt diff --git a/src/main/kotlin/dev/w1zzrd/spigot/landmines2/LandmineEnchantment.kt b/src/main/kotlin/dev/w1zzrd/spigot/landmines2/LandmineEnchantment.kt new file mode 100644 index 0000000..2e17763 --- /dev/null +++ b/src/main/kotlin/dev/w1zzrd/spigot/landmines2/LandmineEnchantment.kt @@ -0,0 +1,17 @@ +package dev.w1zzrd.spigot.landmines2 + +import org.bukkit.NamespacedKey +import org.bukkit.enchantments.Enchantment +import org.bukkit.enchantments.EnchantmentTarget +import org.bukkit.inventory.ItemStack + +class LandmineEnchantment(key: NamespacedKey): Enchantment(key) { + override fun getName() = "Landmine" + override fun getMaxLevel() = 1 + override fun getStartLevel() = 1 + override fun getItemTarget() = EnchantmentTarget.TOOL + override fun isTreasure() = false + override fun isCursed() = true + override fun conflictsWith(other: Enchantment) = true + override fun canEnchantItem(item: ItemStack) = false +} \ No newline at end of file