Improve isAboveLadder by using a bounding box rather.

This commit is contained in:
asofold 2012-10-19 00:04:22 +02:00
parent 040c32d5d0
commit 1efb62c943

View File

@ -208,8 +208,12 @@ public class PlayerLocation {
* @return true, if the player above on stairs
*/
public boolean isAboveStairs() {
if (aboveStairs == null)
aboveStairs = BlockProperties.isStairs(getTypeIdBelow().intValue());
if (aboveStairs == null){
// aboveStairs = BlockProperties.isStairs(getTypeIdBelow().intValue());
// TODO: maybe distinguish upside down stairs and normal stairs !
final double diff = getWidth();
aboveStairs = BlockProperties.collides(getBlockAccess(), x - diff, y + 0.25, z - diff, x + diff, y - 1.0, z + diff, BlockProperties.F_STAIRS);
}
return aboveStairs;
}