mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
world.lua: on_world_tick event
This commit is contained in:
parent
db62a47cc2
commit
ce687a67a3
4 changed files with 13 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue