Removed Backstab

This commit is contained in:
Auxilor
2020-09-30 07:34:13 +01:00
parent 8bd9f1823d
commit b8c31b49b4
3 changed files with 0 additions and 60 deletions

View File

@@ -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

View File

@@ -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));
}
}