diff --git a/src/material/block/DoorBlock.php b/src/material/block/DoorBlock.php index 185dd414..00466a34 100644 --- a/src/material/block/DoorBlock.php +++ b/src/material/block/DoorBlock.php @@ -35,10 +35,12 @@ class DoorBlock extends TransparentBlock{ * * @return bool|int */ - public function onUpdate($type){ + public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ if($this->getSide(0)->getID() === AIR){ //Replace with common break method $this->level->setBlock($this, new AirBlock(), false); + if($this->getID() == 64) ServerAPI::request()->api->entity->drop(new Position($this->x+0.5, $this->y, $this->z+0.5, $this->level), BlockAPI::getItem(324, 0, 1)); + elseif($this->getID() == 71) ServerAPI::request()->api->entity->drop(new Position($this->x+0.5, $this->y, $this->z+0.5, $this->level), BlockAPI::getItem(330, 0, 1)); if($this->getSide(1) instanceof DoorBlock){ $this->level->setBlock($this->getSide(1), new AirBlock(), false); } @@ -48,6 +50,7 @@ class DoorBlock extends TransparentBlock{ return false; } + /** * @param Item $item * @param Player $player diff --git a/src/material/block/nonfull/IronDoor.php b/src/material/block/nonfull/IronDoor.php index 328cde7d..28c75532 100644 --- a/src/material/block/nonfull/IronDoor.php +++ b/src/material/block/nonfull/IronDoor.php @@ -46,17 +46,6 @@ 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( diff --git a/src/material/block/nonfull/WoodDoor.php b/src/material/block/nonfull/WoodDoor.php index 0e1b29c2..10ff9b8a 100644 --- a/src/material/block/nonfull/WoodDoor.php +++ b/src/material/block/nonfull/WoodDoor.php @@ -26,17 +26,6 @@ class WoodDoorBlock extends DoorBlock{ $this->hardness = 15; } - public function onUpdate($type){ - if($type === BLOCK_UPDATE_NORMAL and $meta == 0x8){ - 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),