From d870e0452e7026822aff9c6694657b04f9082858 Mon Sep 17 00:00:00 2001 From: asofold Date: Sun, 12 Aug 2012 06:55:57 +0200 Subject: [PATCH] Correction for dmaage: count in creative + use damage set by event. --- src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java b/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java index 2e83bc01..fdf1da42 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java @@ -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); }