onTick update is toggleable in extra.props.

This commit is contained in:
GameHerobrine 2022-10-18 22:33:23 +03:00
parent 1448fd21b9
commit 08f9193191
5 changed files with 29 additions and 12 deletions

View file

@ -329,7 +329,16 @@ class Level{
}
return $ret;
}
public function onTick(PocketMinecraftServer $server){
$ents = $server->api->entity->getAll($this);
foreach($ents as $e){
if($e->needsUpdate){
$e->update();
}
}
}
public function setBlock(Vector3 $pos, Block $block, $update = true, $tiles = false, $direct = false){
if(!isset($this->level) or (($pos instanceof Position) and $pos->level !== $this) or $pos->x < 0 or $pos->y < 0 or $pos->z < 0){
return false;