mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-30 11:21:21 +01:00
Always apply knockback, once set.
All events that fire also would count, thus we apply velocity always.
This commit is contained in:
parent
972d97ee82
commit
c63008efb3
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user