Day night cycle
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user