Improve crops system
This commit is contained in:
@@ -4,6 +4,7 @@ import { generate_raw_chunk, RawChunk, WorldgenSetup } from "$/common/generation
|
||||
import { AIR_ID, BlockChange } from "$/common/protocol.ts";
|
||||
import { block_value, chunk_key, default_block_value } from "$/common/utils.ts";
|
||||
import { LruMap } from "./lru.ts";
|
||||
import { CYCLE_TICKS } from "$/common/time.ts";
|
||||
|
||||
// generation only, rebuilt when needed. 256 KB each
|
||||
const RAW_CACHE_SIZE = 128;
|
||||
@@ -44,6 +45,11 @@ export class ServerWorld {
|
||||
// ticks since 06:00 of day 1, see common/time.ts
|
||||
time = 0;
|
||||
|
||||
// days since the world started, going up at 06:00. the farming day, unlike the clock's day that starts at midnight
|
||||
get day() {
|
||||
return Math.floor(this.time / CYCLE_TICKS);
|
||||
}
|
||||
|
||||
// set when anything that gets saved changes
|
||||
dirty = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user