mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-02 16:49:39 +01:00
Tweak nofall slightly (performance).
This commit is contained in:
parent
cc7eb2cbce
commit
1b9b83efc8
@ -4,6 +4,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
import net.minecraft.server.EntityPlayer;
|
import net.minecraft.server.EntityPlayer;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -49,8 +50,11 @@ public class NoFall extends Check {
|
|||||||
final MovingData data = MovingData.getData(player);
|
final MovingData data = MovingData.getData(player);
|
||||||
|
|
||||||
if (from.getY() > to.getY()){
|
if (from.getY() > to.getY()){
|
||||||
if (from.getyOnGround() != cc.noFallyOnGround) from.setyOnGround(cc.noFallyOnGround);
|
// Reset the on ground properties only if necessary.
|
||||||
if (to.getyOnGround() != cc.noFallyOnGround) to.setyOnGround(cc.noFallyOnGround);
|
if (from.getyOnGround() != cc.noFallyOnGround && (from.getY() - (double) Location.locToBlock(from.getY()) < cc.noFallyOnGround))
|
||||||
|
from.setyOnGround(cc.noFallyOnGround);
|
||||||
|
if (to.getyOnGround() != cc.noFallyOnGround && (to.getY() - (double) Location.locToBlock(to.getY()) < cc.noFallyOnGround))
|
||||||
|
to.setyOnGround(cc.noFallyOnGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
data.noFallWasOnGround = data.noFallOnGround;
|
data.noFallWasOnGround = data.noFallOnGround;
|
||||||
|
Loading…
Reference in New Issue
Block a user