diff --git a/src/material/block/nonfull/Cake.php b/src/material/block/nonfull/Cake.php index 6462dfd84..ca87ba0d2 100644 --- a/src/material/block/nonfull/Cake.php +++ b/src/material/block/nonfull/Cake.php @@ -33,6 +33,16 @@ class CakeBlock extends TransparentBlock{ $this->meta = $meta & 0x07; } + public function onUpdate($type){ + if($type === BLOCK_UPDATE_NORMAL){ + if($this->getSide(0)->getID() === AIR){ //Replace wit common break method + $this->level->setBlock($this, new AirBlock(), false); + return BLOCK_UPDATE_NORMAL; + } + } + return false; + } + public function getDrops(Item $item, Player $player){ return array(); } diff --git a/src/material/block/nonfull/IronDoor.php b/src/material/block/nonfull/IronDoor.php index 6706deecc..9ba6d7ac8 100644 --- a/src/material/block/nonfull/IronDoor.php +++ b/src/material/block/nonfull/IronDoor.php @@ -30,6 +30,19 @@ class IronDoorBlock extends DoorBlock{ parent::__construct(IRON_DOOR_BLOCK, $meta, "Iron Door Block"); //$this->isActivable = true; } + + public function onUpdate($type){ + if($type === BLOCK_UPDATE_NORMAL){ + if($this->getSide(0)->getID() === AIR){ //Replace wit common break method + $this->level->setBlock($this, new AirBlock(), false); + if($this->getSide(1) instanceof DoorBlock){ + $this->level->setBlock($this->getSide(1), new AirBlock(), false); + } + return BLOCK_UPDATE_NORMAL; + } + } + return false; + } public function getBreakTime(Item $item, Player $player){ if(($player->gamemode & 0x01) === 0x01){