Removed Backstab
This commit is contained in:
@@ -228,7 +228,6 @@ public class EcoEnchants {
|
||||
public static final EcoEnchant INACCURACY_CURSE = new InaccuracyCurse();
|
||||
public static final EcoEnchant RESPIRATOR = new Respirator();
|
||||
public static final EcoEnchant FETCHING = new Fetching();
|
||||
public static final EcoEnchant BACKSTAB = new Backstab();
|
||||
|
||||
/**
|
||||
* Get all registered {@link EcoEnchant}s
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
|
||||
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchantBuilder;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class Backstab extends EcoEnchant {
|
||||
public Backstab() {
|
||||
super(
|
||||
new EcoEnchantBuilder("backstab", EnchantmentType.NORMAL,5.0)
|
||||
);
|
||||
}
|
||||
|
||||
// START OF LISTENERS
|
||||
|
||||
|
||||
@Override
|
||||
public void onMeleeAttack(LivingEntity attacker, LivingEntity victim, int level, EntityDamageByEntityEvent event) {
|
||||
Vector victimLoc = victim.getLocation().toVector();
|
||||
Vector attackerLoc = attacker.getLocation().toVector();
|
||||
Vector locationDelta = victimLoc.subtract(attackerLoc);
|
||||
Vector attackerDirection = attacker.getLocation().getDirection();
|
||||
double dot = locationDelta.dot(attackerDirection);
|
||||
|
||||
if(dot > 0) return;
|
||||
|
||||
event.setDamage(event.getDamage() * ((level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "damage-multiplier-per-level")) + 1));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user