mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-02 00:29:59 +01:00
Correction for dmaage: count in creative + use damage set by event.
This commit is contained in:
parent
78f48b925f
commit
d870e0452e
@ -7,6 +7,7 @@ import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.Packet10Flying;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
||||
@ -78,9 +79,11 @@ public class NoFall extends Check {
|
||||
if (executeActions(player, data.noFallVL, cc.noFallActions)){
|
||||
// Deal the fall damages to the player.
|
||||
// TODO: set accurate fall damage (feather falling etc).
|
||||
final NoFallDamageEvent damageEvent = new NoFallDamageEvent(player, DamageCause.FALL, fallDamage);
|
||||
Bukkit.getPluginManager().callEvent(damageEvent);
|
||||
if (!damageEvent.isCancelled()) player.damage(fallDamage);
|
||||
if (player.getGameMode() != GameMode.CREATIVE){
|
||||
final NoFallDamageEvent damageEvent = new NoFallDamageEvent(player, DamageCause.FALL, fallDamage);
|
||||
Bukkit.getPluginManager().callEvent(damageEvent);
|
||||
if (!damageEvent.isCancelled()) player.damage(damageEvent.getDamage());
|
||||
}
|
||||
data.noFallFallDistance = 0.0;
|
||||
player.setFallDistance(0.0f);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user