Added Ladder bounding box

This commit is contained in:
Shoghi Cervantes 2014-08-30 23:45:08 +02:00
parent fa5f00a1ff
commit a23352be88
2 changed files with 42 additions and 1 deletions

View File

@ -42,7 +42,7 @@ class FenceGate extends Transparent{
if($this->getDamage() !== 2 and $this->getDamage() !== 0){
return new AxisAlignedBB(
$this->x + 0.375,
$this->y + 0.0,
$this->y,
$this->z,
$this->x + 0.625,
$this->y + 1,

View File

@ -23,6 +23,7 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\AxisAlignedBB;
use pocketmine\Player;
class Ladder extends Transparent{
@ -34,6 +35,46 @@ class Ladder extends Transparent{
}
public function getBoundingBox(){
$f = 0.125;
if($this->meta === 2){
return new AxisAlignedBB(
$this->x,
$this->y,
$this->z + 1 - $f,
$this->x + 1,
$this->y + 1,
$this->z + 1
);
}elseif($this->meta === 3){
return new AxisAlignedBB(
$this->x,
$this->y,
$this->z,
$this->x + 1,
$this->y + 1,
$this->z + $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
);
}elseif($this->meta === 5){
return new AxisAlignedBB(
$this->x,
$this->y,
$this->z,
$this->x + $f,
$this->y + 1,
$this->z + 1
);
}
return null;
}