From 42033da08bf93e412bf648a40638d78fad3a50e5 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Tue, 16 Sep 2014 00:47:04 +0200 Subject: [PATCH] Fixed #2035 Invalid Fence Gate bounding box --- src/pocketmine/block/FenceGate.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) 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 + ); } }