From f959cf7bc362b100afb80793115108cf4905f36d Mon Sep 17 00:00:00 2001 From: ArkQuark <74979909+ArkQuark@users.noreply.github.com> Date: Wed, 4 May 2022 21:13:01 +0300 Subject: [PATCH] Update IronDoor.php --- src/material/block/nonfull/IronDoor.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/material/block/nonfull/IronDoor.php b/src/material/block/nonfull/IronDoor.php index d8d41ec8..328cde7d 100644 --- a/src/material/block/nonfull/IronDoor.php +++ b/src/material/block/nonfull/IronDoor.php @@ -46,6 +46,17 @@ class IronDoorBlock extends DoorBlock{ } } + 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){ if($item->isPickaxe() >= 1){ return array( @@ -55,4 +66,4 @@ class IronDoorBlock extends DoorBlock{ return array(); } } -} \ No newline at end of file +}