mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-26 15:45:12 +01:00
Removed Aversion due to awful performance
This commit is contained in:
parent
3f06975775
commit
66afc6d9ab
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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.
|
Loading…
Reference in New Issue
Block a user