Always apply knockback, once set.

All events that fire also would count, thus we apply velocity always.
This commit is contained in:
asofold 2015-01-13 01:58:38 +01:00
parent 972d97ee82
commit c63008efb3

View File

@ -512,14 +512,14 @@ public class FightListener extends CheckListener implements JoinLeaveListener{
// Plugin compatibility thing. // Plugin compatibility thing.
damagedData.lastNoDamageTicks = ndt; damagedData.lastNoDamageTicks = ndt;
} }
// Skip events that would not count. // // Skip events that would not count.
if (ndt >= damagedPlayer.getMaximumNoDamageTicks() / 2) { // TODO: Exact bounds. // if (ndt >= damagedPlayer.getMaximumNoDamageTicks() / 2) { // TODO: Exact bounds.
final EntityDamageEvent lastDamage = damaged.getLastDamageCause(); // final EntityDamageEvent lastDamage = damaged.getLastDamageCause();
if (lastDamage != null && BridgeHealth.getFinalDamage(lastDamage) <= BridgeHealth.getFinalDamage(event)) { // if (lastDamage != null && BridgeHealth.getFinalDamage(lastDamage) <= BridgeHealth.getFinalDamage(event)) {
return; // return;
} // }
} // }
// Knockback calculation. // Knock-back calculation (1.8: events only fire if they would count).
switch (event.getCause()) { switch (event.getCause()) {
case ENTITY_ATTACK: case ENTITY_ATTACK:
if (event instanceof EntityDamageByEntityEvent) { if (event instanceof EntityDamageByEntityEvent) {