Skip to content

Commit

Permalink
Use the bounds coordinates as intended.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Jan 26, 2016
1 parent c20d593 commit 36c018b
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -446,7 +446,7 @@ public boolean canClimbUp(double jumpHeigth) {
return true;
}
// Check the block at head height.
final int headY = Location.locToBlock(y + eyeHeight);
final int headY = Location.locToBlock(maxY);
if (headY > blockY) {
for (int cy = blockY + 1; cy <= headY; cy ++) {
if (BlockProperties.canClimbUp(blockCache, blockX, cy, blockZ)) {
Expand Down Expand Up @@ -701,7 +701,7 @@ public boolean isResetCond() {
* @return
*/
public boolean isHeadObstructed(double marginAboveEyeHeight) {
return BlockProperties.collides(blockCache, x - width, y + eyeHeight, z - width, x + width, y + eyeHeight + marginAboveEyeHeight, z + width, BlockProperties.F_GROUND | BlockProperties.F_SOLID);
return BlockProperties.collides(blockCache, minX , maxY, minZ, maxX, maxY + marginAboveEyeHeight, maxZ, BlockProperties.F_GROUND | BlockProperties.F_SOLID);
}

/**
Expand Down

0 comments on commit 36c018b

Please sign in to comment.