mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-02 08:40:01 +01:00
Exempt players in creative mode from NoFall handling.
This commit is contained in:
parent
7cd74f38d4
commit
204e416a96
@ -7,6 +7,7 @@ import net.minecraft.server.DamageSource;
|
|||||||
import net.minecraft.server.EntityPlayer;
|
import net.minecraft.server.EntityPlayer;
|
||||||
import net.minecraft.server.Packet10Flying;
|
import net.minecraft.server.Packet10Flying;
|
||||||
|
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -51,11 +52,20 @@ public class NoFall extends Check {
|
|||||||
final MovingConfig cc = MovingConfig.getConfig(player);
|
final MovingConfig cc = MovingConfig.getConfig(player);
|
||||||
final MovingData data = MovingData.getData(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 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())
|
if (to.isInLiquid() || to.isInWeb() || to.isOnLadder())
|
||||||
// Reset his fall distance.
|
// Reset his fall distance.
|
||||||
data.noFallFallDistance = data.noFallNewFallDistance = 0D;
|
data.noFallFallDistance = data.noFallNewFallDistance = 0D;
|
||||||
|
|
||||||
|
|
||||||
// If the player just touched the ground for the server, but no for the client.
|
// If the player just touched the ground for the server, but no for the client.
|
||||||
if (!data.noFallWasOnGroundServer && data.noFallOnGroundServer
|
if (!data.noFallWasOnGroundServer && data.noFallOnGroundServer
|
||||||
&& (data.noFallWasOnGroundClient || !data.noFallOnGroundClient)) {
|
&& (data.noFallWasOnGroundClient || !data.noFallOnGroundClient)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user