mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +00:00
Added Cake bounding boxe
This commit is contained in:
parent
d3a05adede
commit
fa5f00a1ff
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
class Cake extends Transparent{
|
class Cake extends Transparent{
|
||||||
@ -34,6 +35,19 @@ class Cake extends Transparent{
|
|||||||
$this->hardness = 2.5;
|
$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){
|
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||||
$down = $this->getSide(0);
|
$down = $this->getSide(0);
|
||||||
if($down->getID() !== self::AIR){
|
if($down->getID() !== self::AIR){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user