This commit is contained in:
Michael Yoo 2013-10-19 11:20:33 +10:30
parent 58fce0e939
commit 386b2cb0ef

View File

@ -42,6 +42,18 @@ class LadderBlock extends TransparentBlock{
}
return false;
}
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(LADDER, 0, 1));
$this->level->setBlock($this, new AirBlock(), true, true, true);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function getDrops(Item $item, Player $player){
return array(
array($this->id, 0, 1),