diff --git a/src/material/block/nonfull/WoodDoor.php b/src/material/block/nonfull/WoodDoor.php index ee310b75..cdb48404 100644 --- a/src/material/block/nonfull/WoodDoor.php +++ b/src/material/block/nonfull/WoodDoor.php @@ -26,9 +26,20 @@ class WoodDoorBlock extends DoorBlock{ $this->hardness = 15; } + public function onUpdate($type){ + if($type === BLOCK_UPDATE_NORMAL){ + if($this->getSide(0)->getID() === AIR){ //Replace with common break method + ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id, $this->meta, 1)); + $this->level->setBlock($this, new AirBlock(), true, false, true); + return BLOCK_UPDATE_NORMAL; + } + } + return false; + } + public function getDrops(Item $item, Player $player){ return array( array(WOODEN_DOOR, 0, 1), ); } -} \ No newline at end of file +}