Seasons based on a calendar
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user