diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java index d3e6a64b..a068855b 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java @@ -65,7 +65,6 @@ import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Arachnid; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Arborist; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Arcanic; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Atmospheric; -import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Aversion; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Backstab; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Beheading; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.BlastMining; @@ -489,7 +488,6 @@ public class EcoEnchants { public static final EcoEnchant ASCEND = new Ascend(); public static final EcoEnchant ARBORIST = new Arborist(); public static final EcoEnchant LUCKY_CATCH = new LuckyCatch(); - public static final EcoEnchant AVERSION = new Aversion(); public static final EcoEnchant INTROVERSION = new Introversion(); public static final EcoEnchant VILLAGER_ARTIFACT = new VillagerArtifact(); public static final EcoEnchant ANGER_ARTIFACT = new AngerArtifact(); diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aversion.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aversion.java deleted file mode 100644 index 4ce368d0..00000000 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aversion.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.willfp.ecoenchants.enchantments.ecoenchants.normal; - -import com.willfp.ecoenchants.enchantments.EcoEnchant; -import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; -import com.willfp.ecoenchants.enchantments.util.EnchantChecks; -import org.bukkit.entity.Enderman; -import org.bukkit.entity.LivingEntity; -import org.bukkit.event.EventHandler; -import org.bukkit.event.entity.EntityTargetEvent; -import org.bukkit.event.entity.EntityTargetLivingEntityEvent; -import org.jetbrains.annotations.NotNull; - -public class Aversion extends EcoEnchant { - public Aversion() { - super( - "aversion", EnchantmentType.NORMAL - ); - } - - @EventHandler - public void onEndermanTarget(@NotNull final EntityTargetLivingEntityEvent event) { - if (!(event.getEntity() instanceof Enderman enderman)) { - return; - } - - LivingEntity target = event.getTarget(); - - if (event.getReason() != EntityTargetEvent.TargetReason.CLOSEST_PLAYER) { - return; - } - - if (target == null) { - return; - } - - int level = EnchantChecks.getHelmetLevel(target, this); - - if (level == 0) { - return; - } - - if (this.getDisabledWorlds().contains(target.getWorld())) { - return; - } - - event.setCancelled(true); - } -} diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/aversion.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/aversion.yml deleted file mode 100644 index 11ac93ff..00000000 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/aversion.yml +++ /dev/null @@ -1,24 +0,0 @@ -# -# Aversion EcoEnchant -# - -name: "Aversion" -description: Prevents angering endermen by looking at them. -enabled: true - -obtaining: - table: true - villager: true - loot: true - rarity: epic - -general-config: - flags: [] - targets: - - helmet - grindstoneable: true - disabled-in-worlds: [ ] - conflicts: [ ] - -config: -# No config is available for this enchantment.