From f882c8bc8c8b55c4dbffa1cbb8be037e11ca73a2 Mon Sep 17 00:00:00 2001 From: asofold Date: Sat, 9 Mar 2013 20:04:16 +0100 Subject: [PATCH] Another attempt to set the bounding box (use Math.round). --- .../nocheatplus/utilities/PlayerLocation.java | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java b/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java index f7654a89..ea92a051 100644 --- a/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java +++ b/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java @@ -33,13 +33,6 @@ import fr.neatmonster.nocheatplus.compat.MCAccess; */ public class PlayerLocation { - /** - * This is only for x+ and z+, since those provide trouble with falling through narrow places. - *
- * TODO: Check for closest value to 0.X (1 digit), dynamically ? - */ - private static final double xzInset = 0.0000001; - // Final members // private final MCAccess mcAccess; @@ -720,27 +713,15 @@ 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 = 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 ? + // TODO: inset, outset ? this.width = mcAccess.getWidth(player); - final double dxz = this.width / 2; -// 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; + final double dxz = Math.round(this.width * 500.0) / 1000.0;// 0.3; // this.width / 2; minX = x - dxz; minY = y; minZ = z - dxz; - maxX = x + dxz - xzInset; + maxX = x + dxz;// - xzInset; maxY = y + player.getEyeHeight(); - maxZ = z + dxz - xzInset; + maxZ = z + dxz;// - xzInset; // TODO: With current bounding box the stance is never checked. // Set world / block access.