Experimental: Do not rely on the actual players bounding box.

Just takes into account EntityPlayer.width/2 and Player.getEyeHeight.
This commit is contained in:
asofold 2012-11-12 11:59:34 +01:00
parent f89cc50a6e
commit e0e5998f04

View File

@ -301,6 +301,7 @@ public class PlayerLocation {
*/ */
public boolean isAboveLadder() { public boolean isAboveLadder() {
final int typeId = getTypeIdBelow(); final int typeId = getTypeIdBelow();
// TODO: bounding box ...
return typeId == Material.LADDER.getId() || typeId == Material.VINE.getId(); return typeId == Material.LADDER.getId() || typeId == Material.VINE.getId();
} }
@ -487,15 +488,17 @@ public class PlayerLocation {
pitch = location.getPitch(); pitch = location.getPitch();
// Set bounding box. // Set bounding box.
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;
minX = entityPlayer.boundingBox.a + dX; // TODO: inset, outset ?
minY = entityPlayer.boundingBox.b + dY; final double dxz = entityPlayer.width/2;
minZ = entityPlayer.boundingBox.c + dZ; minX = x - dxz; //entityPlayer.boundingBox.a + dX;
maxX = entityPlayer.boundingBox.d + dX; minY = y; // entityPlayer.boundingBox.b + dY;
maxY = entityPlayer.boundingBox.e + dY; minZ = z - dxz; //entityPlayer.boundingBox.c + dZ;
maxZ = entityPlayer.boundingBox.f + 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. // Set world / block access.
world = location.getWorld(); world = location.getWorld();