From 204e416a96934527d3b56360cd873ec4dcdff5b4 Mon Sep 17 00:00:00 2001 From: asofold Date: Mon, 13 Aug 2012 16:24:44 +0200 Subject: [PATCH] Exempt players in creative mode from NoFall handling. --- .../neatmonster/nocheatplus/checks/moving/NoFall.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java b/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java index ad063a3c..371885bd 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.DamageSource; import net.minecraft.server.EntityPlayer; import net.minecraft.server.Packet10Flying; +import org.bukkit.GameMode; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.Player; @@ -51,10 +52,19 @@ public class NoFall extends Check { final MovingConfig cc = MovingConfig.getConfig(player); final MovingData data = MovingData.getData(player); + // Exempt players with creative mode from checks. + if (player.getGameMode() == GameMode.CREATIVE){ + // Reset his fall distance. + data.noFallFallDistance = data.noFallNewFallDistance = 0D; + data.noFallVL *= 0.95D; + return; + } + // If the player has just started falling, is falling into a liquid, in web or is on a ladder. if (to.isInLiquid() || to.isInWeb() || to.isOnLadder()) // Reset his fall distance. data.noFallFallDistance = data.noFallNewFallDistance = 0D; + // If the player just touched the ground for the server, but no for the client. if (!data.noFallWasOnGroundServer && data.noFallOnGroundServer