From b4302edc4854a347b8779b061a3e7202d9bbc684 Mon Sep 17 00:00:00 2001 From: asofold Date: Thu, 15 Nov 2012 00:15:18 +0100 Subject: [PATCH] Adapt bounds for onground checking minimally (back to 0). --- .../nocheatplus/utilities/PlayerLocation.java | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java b/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java index 47701ea9..1bfcb2f4 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java +++ b/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java @@ -325,7 +325,7 @@ public class PlayerLocation { */ public boolean isOnGround() { if (onGround == null) { - final double d0 = 0.01D; + final double d0 = 0; //0.001D; onGround = BlockProperties.isOnGround(getBlockAccess(), minX - d0, minY - yOnGround, minZ - d0, maxX + d0, minY + 0.25, maxZ + d0); if (!onGround) { // TODO: Probably check other ids too before doing this ? @@ -491,14 +491,24 @@ public class PlayerLocation { // final double dX = x - entityPlayer.locX; // final double dY = y - entityPlayer.locY; // final double dZ = z - entityPlayer.locZ; - // TODO: inset, outset ? +// minX = x - entityPlayer.boundingBox.a + dX; +// minY = y - entityPlayer.boundingBox.b + dY; +// minZ = z - entityPlayer.boundingBox.c + dZ; +// maxX = x + entityPlayer.boundingBox.d + dX; +// maxY = y + entityPlayer.boundingBox.e + dY; +// maxZ = z + entityPlayer.boundingBox.f + dZ; +// // TODO: inset, outset ? final double dxz = entityPlayer.width/2; - minX = x - dxz; //entityPlayer.boundingBox.a + dX; - minY = y; // entityPlayer.boundingBox.b + dY; - minZ = z - dxz; //entityPlayer.boundingBox.c + dZ; - maxX = x + dxz; //entityPlayer.boundingBox.d + dX; - maxY = y + player.getEyeHeight(); // entityPlayer.boundingBox.e + dY; - maxZ = z + dxz; //entityPlayer.boundingBox.f + dZ; +// final double dX = (entityPlayer.boundingBox.d - entityPlayer.boundingBox.a) / 2D; +// final double dY = entityPlayer.boundingBox.e - entityPlayer.boundingBox.b; +// final double dZ = (entityPlayer.boundingBox.f - entityPlayer.boundingBox.c) / 2D; + minX = x - dxz; + minY = y; + minZ = z - dxz; + maxX = x + dxz; + maxY = y + player.getEyeHeight(); + maxZ = z + dxz; + // TODO: With current bounding box the stance is never checked. // Set world / block access. world = location.getWorld();