Seasons based on a calendar

This commit is contained in:
2026-10-09 22:09:21 -03:00
parent 4d5700f0bf
commit 7fe9c15b67
12 changed files with 88 additions and 33 deletions
+5
View File
@@ -4,6 +4,7 @@
import { CHUNK_SIZE } from "$/common/constants.ts";
import { is_within_view } from "$/common/chunk_streaming.ts";
import { liquid_block, liquid_in_cell } from "$/common/utils.ts";
import { biome_season } from "$/common/worldgen/biomes.ts";
import type { ItemStack } from "$/common/inventory.ts";
import type { EntityEvent, EntityInfo, ServerMessage } from "$/common/protocol.ts";
import type { ServerPlayer } from "../player.ts";
@@ -108,6 +109,10 @@ export class EntityManager implements EntityLevel {
return this.#host.world.biome_at(x, z);
}
season_at(x: number, z: number) {
return biome_season(this.biome_at(x, z), this.#host.world.time);
}
liquid_at(x: number, y: number, z: number) {
const world = this.#host.world;
return liquid_in_cell(world.get_block_value(x, y, z), world.get_block_info(x, y, z));