world.lua: on_world_tick event

This commit is contained in:
MihailRis
2024-03-15 00:38:44 +03:00
parent db62a47cc2
commit ce687a67a3
4 changed files with 13 additions and 0 deletions
+4
View File
@@ -57,6 +57,7 @@ BlocksController::BlocksController(Level* level, uint padding)
lighting(level->lighting.get()),
randTickClock(20, 3),
blocksTickClock(20, 1),
worldTickClock(20, 1),
padding(padding) {
}
@@ -99,6 +100,9 @@ void BlocksController::update(float delta) {
if (blocksTickClock.update(delta)) {
onBlocksTick(blocksTickClock.getPart(), blocksTickClock.getParts());
}
if (worldTickClock.update(delta)) {
scripting::on_world_tick();
}
}
void BlocksController::onBlocksTick(int tickid, int parts) {