Added Cake bounding boxe

This commit is contained in:
Shoghi Cervantes 2014-08-30 23:42:07 +02:00
parent d3a05adede
commit fa5f00a1ff

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 Cake extends Transparent{
@ -34,6 +35,19 @@ class Cake extends Transparent{
$this->hardness = 2.5;
}
public function getBoundingBox(){
$f = (1 + $this->getDamage() * 2) / 16;
return new AxisAlignedBB(
$this->x + $f,
$this->y,
$this->z + 0.0625,
$this->x + 1 - 0.0625,
$this->y + 0.5,
$this->z + 1 - 0.0625
);
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->getID() !== self::AIR){