From c63008efb3abcf7f210175980451a8597aed1212 Mon Sep 17 00:00:00 2001 From: asofold Date: Tue, 13 Jan 2015 01:58:38 +0100 Subject: [PATCH] Always apply knockback, once set. All events that fire also would count, thus we apply velocity always. --- .../nocheatplus/checks/fight/FightListener.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/fight/FightListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/fight/FightListener.java index b84ad838..344003ba 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/fight/FightListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/fight/FightListener.java @@ -512,14 +512,14 @@ public class FightListener extends CheckListener implements JoinLeaveListener{ // Plugin compatibility thing. damagedData.lastNoDamageTicks = ndt; } - // Skip events that would not count. - if (ndt >= damagedPlayer.getMaximumNoDamageTicks() / 2) { // TODO: Exact bounds. - final EntityDamageEvent lastDamage = damaged.getLastDamageCause(); - if (lastDamage != null && BridgeHealth.getFinalDamage(lastDamage) <= BridgeHealth.getFinalDamage(event)) { - return; - } - } - // Knockback calculation. + // // Skip events that would not count. + // if (ndt >= damagedPlayer.getMaximumNoDamageTicks() / 2) { // TODO: Exact bounds. + // final EntityDamageEvent lastDamage = damaged.getLastDamageCause(); + // if (lastDamage != null && BridgeHealth.getFinalDamage(lastDamage) <= BridgeHealth.getFinalDamage(event)) { + // return; + // } + // } + // Knock-back calculation (1.8: events only fire if they would count). switch (event.getCause()) { case ENTITY_ATTACK: if (event instanceof EntityDamageByEntityEvent) {