diff --git a/src/pocketmine/block/FenceGate.php b/src/pocketmine/block/FenceGate.php index 42a88341d..9d9a85779 100644 --- a/src/pocketmine/block/FenceGate.php +++ b/src/pocketmine/block/FenceGate.php @@ -39,16 +39,12 @@ class FenceGate extends Transparent{ public function getBoundingBox(){ - if($this->getDamage() !== 2 and $this->getDamage() !== 0){ - return new AxisAlignedBB( - $this->x + 0.375, - $this->y, - $this->z, - $this->x + 0.625, - $this->y + 1, - $this->z + 1 - ); - }else{ + if(($this->getDamage() & 0x04) > 0){ + return null; + } + + $i = ($this->getDamage() & 0x03); + if($i === 2 and $i === 0){ return new AxisAlignedBB( $this->x, $this->y, @@ -57,6 +53,15 @@ class FenceGate extends Transparent{ $this->y + 1, $this->z + 0.625 ); + }else{ + return new AxisAlignedBB( + $this->x + 0.375, + $this->y, + $this->z, + $this->x + 0.625, + $this->y + 1, + $this->z + 1 + ); } }