mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
onUpdate is now static, disabled rail, water and lava updates to rework.
This commit is contained in:
parent
3c37dc446e
commit
ee989ef556
38 changed files with 329 additions and 367 deletions
|
|
@ -33,13 +33,12 @@ class SignPostBlock 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(SIGN, 0, 1));
|
||||
$this->level->setBlock($this, new AirBlock(), true, true, true);
|
||||
return BLOCK_UPDATE_NORMAL;
|
||||
}
|
||||
public static function onUpdate(Level $level, $x, $y, $z, $type){ //TODO remove $type
|
||||
if($level->level->getBlockID($x, $y - 1, $z) === AIR){ //Replace with common break method
|
||||
ServerAPI::request()->api->entity->drop(new Position($x, $y, $z, $level), BlockAPI::getItem(SIGN, 0, 1));
|
||||
//$this->level->setBlock($this, new AirBlock(), true, true, true);
|
||||
$level->fastSetBlockUpdate($x, $y, $z, 0, 0, true, true);
|
||||
return BLOCK_UPDATE_NORMAL;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue