mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 21:19:44 +00:00
Update WoodDoor.php
This commit is contained in:
parent
f959cf7bc3
commit
5139245927
1 changed files with 12 additions and 1 deletions
|
|
@ -26,6 +26,17 @@ class WoodDoorBlock extends DoorBlock{
|
||||||
$this->hardness = 15;
|
$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){
|
public function getDrops(Item $item, Player $player){
|
||||||
return array(
|
return array(
|
||||||
array(WOODEN_DOOR, 0, 1),
|
array(WOODEN_DOOR, 0, 1),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue