Adapt bounds for onground checking minimally (back to 0).

This commit is contained in:
asofold 2012-11-15 00:15:18 +01:00
parent e9a3fc6974
commit b4302edc48

View File

@ -325,7 +325,7 @@ public class PlayerLocation {
*/ */
public boolean isOnGround() { public boolean isOnGround() {
if (onGround == null) { 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); onGround = BlockProperties.isOnGround(getBlockAccess(), minX - d0, minY - yOnGround, minZ - d0, maxX + d0, minY + 0.25, maxZ + d0);
if (!onGround) { if (!onGround) {
// TODO: Probably check other ids too before doing this ? // TODO: Probably check other ids too before doing this ?
@ -491,14 +491,24 @@ public class PlayerLocation {
// final double dX = x - entityPlayer.locX; // final double dX = x - entityPlayer.locX;
// final double dY = y - entityPlayer.locY; // final double dY = y - entityPlayer.locY;
// final double dZ = z - entityPlayer.locZ; // 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; final double dxz = entityPlayer.width/2;
minX = x - dxz; //entityPlayer.boundingBox.a + dX; // final double dX = (entityPlayer.boundingBox.d - entityPlayer.boundingBox.a) / 2D;
minY = y; // entityPlayer.boundingBox.b + dY; // final double dY = entityPlayer.boundingBox.e - entityPlayer.boundingBox.b;
minZ = z - dxz; //entityPlayer.boundingBox.c + dZ; // final double dZ = (entityPlayer.boundingBox.f - entityPlayer.boundingBox.c) / 2D;
maxX = x + dxz; //entityPlayer.boundingBox.d + dX; minX = x - dxz;
maxY = y + player.getEyeHeight(); // entityPlayer.boundingBox.e + dY; minY = y;
maxZ = z + dxz; //entityPlayer.boundingBox.f + dZ; 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. // Set world / block access.
world = location.getWorld(); world = location.getWorld();