Seasons api

This commit is contained in:
2026-10-08 13:42:18 -03:00
parent 7e7ac8f6f4
commit dd66d6caa7
16 changed files with 231 additions and 10 deletions
+2
View File
@@ -70,6 +70,8 @@ export interface EntityLevel {
// the liquid there and how high it is, for liquids pushing things along
liquid_at(x: number, y: number, z: number): LiquidInCell | undefined;
get_block_info(x: number, y: number, z: number): BlockRegistry | undefined;
// the column's biome, like "bworld:plains"
biome_at(x: number, z: number): string;
add_entity(entity: Entity): void;
get_entity(id: string): Entity | undefined;
// entities whose feet are within the box around x, y, z
+4
View File
@@ -104,6 +104,10 @@ export class EntityManager implements EntityLevel {
return this.#host.world.get_block_info(x, y, z);
}
biome_at(x: number, z: number) {
return this.#host.world.biome_at(x, z);
}
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));