mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Fixed deflection stack overflow
This commit is contained in:
parent
e55e7d8882
commit
7b1768f64c
@ -20,6 +20,14 @@ public class Deflection extends EcoEnchant {
|
||||
@NotNull final LivingEntity attacker,
|
||||
final int level,
|
||||
@NotNull final EntityDamageByEntityEvent event) {
|
||||
if (blocker.hasMetadata("cleaved") || blocker.hasMetadata("carved")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (attacker.hasMetadata("cleaved") || attacker.hasMetadata("carved")) {
|
||||
return;
|
||||
}
|
||||
|
||||
double perlevel = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "percent-deflected-per-level");
|
||||
double damagePercent = (perlevel / 100) * level;
|
||||
double damage = event.getDamage() * damagePercent;
|
||||
|
Loading…
Reference in New Issue
Block a user