From e0e5998f04f62cca3428402b749225d710db0232 Mon Sep 17 00:00:00 2001 From: asofold Date: Mon, 12 Nov 2012 11:59:34 +0100 Subject: [PATCH] Experimental: Do not rely on the actual players bounding box. Just takes into account EntityPlayer.width/2 and Player.getEyeHeight. --- .../nocheatplus/utilities/PlayerLocation.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java b/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java index 14d30b38..47701ea9 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java +++ b/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java @@ -301,6 +301,7 @@ public class PlayerLocation { */ public boolean isAboveLadder() { final int typeId = getTypeIdBelow(); + // TODO: bounding box ... return typeId == Material.LADDER.getId() || typeId == Material.VINE.getId(); } @@ -487,15 +488,17 @@ public class PlayerLocation { pitch = location.getPitch(); // Set bounding box. - final double dX = x - entityPlayer.locX; - final double dY = y - entityPlayer.locY; - final double dZ = z - entityPlayer.locZ; - minX = entityPlayer.boundingBox.a + dX; - minY = entityPlayer.boundingBox.b + dY; - minZ = entityPlayer.boundingBox.c + dZ; - maxX = entityPlayer.boundingBox.d + dX; - maxY = entityPlayer.boundingBox.e + dY; - maxZ = entityPlayer.boundingBox.f + dZ; +// final double dX = x - entityPlayer.locX; +// final double dY = y - entityPlayer.locY; +// final double dZ = z - entityPlayer.locZ; + // 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; // Set world / block access. world = location.getWorld();