Day night cycle

This commit is contained in:
2026-09-26 11:03:07 -03:00
parent 8f32a59bd6
commit 8b549162c4
16 changed files with 244 additions and 6 deletions
+3
View File
@@ -87,6 +87,8 @@ export class ClientLevel {
second_timer = 0;
tick_timer = 0;
seed: string;
// world time in ticks, counted here between the server's updates. see common/time.ts
time = 0;
// blocks players changed from the generated terrain, per chunk, so they survive reloading chunks
changes = new Map<string, Map<string, BlockChange>>();
@@ -129,6 +131,7 @@ export class ClientLevel {
}
tick() {
this.time += 1;
for (const entity of this.entities.values()) {
entity.save_previous_position();
entity.tick();