diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index 0dd8221f2..816307f69 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -65,48 +65,29 @@ class Ladder extends Transparent{ } protected function recalculateBoundingBox(){ - $f = 0.1875; + $minX = $minZ = 0; + $maxX = $maxZ = 1; + if($this->meta === 2){ - return new AxisAlignedBB( - $this->x, - $this->y, - $this->z + 1 - $f, - $this->x + 1, - $this->y + 1, - $this->z + 1 - ); + $minZ = 1 - $f; }elseif($this->meta === 3){ - return new AxisAlignedBB( - $this->x, - $this->y, - $this->z, - $this->x + 1, - $this->y + 1, - $this->z + $f - ); + $maxZ = $f; }elseif($this->meta === 4){ - return new AxisAlignedBB( - $this->x + 1 - $f, - $this->y, - $this->z, - $this->x + 1, - $this->y + 1, - $this->z + 1 - ); + $minX = 1 - $f; }elseif($this->meta === 5){ - return new AxisAlignedBB( - $this->x, - $this->y, - $this->z, - $this->x + $f, - $this->y + 1, - $this->z + 1 - ); + $maxX = $f; } - return null; + return new AxisAlignedBB( + $this->x + $minX, + $this->y, + $this->z + $minZ, + $this->x + $maxX, + $this->y + 1, + $this->z + $maxZ + ); }