Fixed #2035 Invalid Fence Gate bounding box

This commit is contained in:
Shoghi Cervantes 2014-09-16 00:47:04 +02:00
parent 69ab0d433b
commit 42033da08b

View File

@ -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
);
}
}