Back to checking the bounding box height.

This commit is contained in:
asofold 2012-11-15 21:23:43 +01:00
parent d6109bc150
commit 5cdb050784
2 changed files with 3 additions and 3 deletions

View File

@ -350,6 +350,6 @@ public class CheckUtils {
public static void onIllegalMove(final Player player){ public static void onIllegalMove(final Player player){
player.kickPlayer("Illegal move."); player.kickPlayer("Illegal move.");
logWarning("[NCP] Disconnect " + player.getName() + " due to illegal move!"); LogUtil.logWarning("[NCP] Disconnect " + player.getName() + " due to illegal move!");
} }
} }

View File

@ -288,7 +288,7 @@ public class PlayerLocation {
public boolean isOnClimbable() { public boolean isOnClimbable() {
if (onClimbable == null) { if (onClimbable == null) {
// Climbable blocks. // Climbable blocks.
onClimbable = typeId == Material.LADDER.getId() || typeId == Material.VINE.getId(); onClimbable = getTypeId() == Material.LADDER.getId() || typeId == Material.VINE.getId();
// TODO: maybe use specialized bounding box. // TODO: maybe use specialized bounding box.
// final double d = 0.1d; // final double d = 0.1d;
// onClimbable = BlockProperties.collides(getBlockAccess(), minX - d, minY - d, minZ - d, maxX + d, minY + 1.0, maxZ + d, BlockProperties.F_CLIMBABLE); // onClimbable = BlockProperties.collides(getBlockAccess(), minX - d, minY - d, minZ - d, maxX + d, minY + 1.0, maxZ + d, BlockProperties.F_CLIMBABLE);
@ -546,7 +546,7 @@ public class PlayerLocation {
if (entityPlayer.dead) return false; if (entityPlayer.dead) return false;
if (!entityPlayer.isSleeping()){ if (!entityPlayer.isSleeping()){
// This can not really test stance but height of bounding box. // This can not really test stance but height of bounding box.
final double dY = Math.abs(maxY - minY); final double dY = Math.abs(entityPlayer.boundingBox.e - entityPlayer.boundingBox.b);
if (dY > 1.8) return true; // dY > 1.65D || if (dY > 1.8) return true; // dY > 1.65D ||
if (dY < 0.1D) return true; if (dY < 0.1D) return true;
} }