mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Fixed #2035 Invalid Fence Gate bounding box
This commit is contained in:
@ -39,16 +39,12 @@ class FenceGate extends Transparent{
|
|||||||
|
|
||||||
|
|
||||||
public function getBoundingBox(){
|
public function getBoundingBox(){
|
||||||
if($this->getDamage() !== 2 and $this->getDamage() !== 0){
|
if(($this->getDamage() & 0x04) > 0){
|
||||||
return new AxisAlignedBB(
|
return null;
|
||||||
$this->x + 0.375,
|
}
|
||||||
$this->y,
|
|
||||||
$this->z,
|
$i = ($this->getDamage() & 0x03);
|
||||||
$this->x + 0.625,
|
if($i === 2 and $i === 0){
|
||||||
$this->y + 1,
|
|
||||||
$this->z + 1
|
|
||||||
);
|
|
||||||
}else{
|
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
$this->y,
|
$this->y,
|
||||||
@ -57,6 +53,15 @@ class FenceGate extends Transparent{
|
|||||||
$this->y + 1,
|
$this->y + 1,
|
||||||
$this->z + 0.625
|
$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
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user