3D biomes

This commit is contained in:
2026-11-07 12:13:43 -03:00
parent b726ce9695
commit 22191d260c
53 changed files with 874 additions and 316 deletions
+9 -9
View File
@@ -92,9 +92,9 @@ const rules_world: SharedWorld = {
const shape = client?.level.collision_shape(x, y, z) ?? false;
return covers_face(shape === true ? FULL_SHAPE : shape === false ? EMPTY_SHAPE : shape, face);
},
biome_at: (x, z) => client?.level.biome_at(Math.floor(x), Math.floor(z)),
season_at(x, z) {
const biome = this.biome_at(x, z);
biome_at: (x, y, z) => client?.level.biome_at(Math.floor(x), Math.floor(y), Math.floor(z)),
season_at(x, y, z) {
const biome = this.biome_at(x, y, z);
return biome === undefined ? undefined : biome_season(biome, client!.level.time);
},
};
@@ -340,12 +340,12 @@ function client_context(listing: ModListing): ClientContext {
return { x, y, z };
},
get biome() {
const { x, z } = need_client().player;
return rules_world.biome_at(x, z);
const { x, y, z } = need_client().player;
return rules_world.biome_at(x, y, z);
},
get season() {
const { x, z } = need_client().player;
return rules_world.season_at(x, z);
const { x, y, z } = need_client().player;
return rules_world.season_at(x, y, z);
},
is_swimming: () => need_client().player.swimming,
is_sneaking: () => need_client().player.holding_sneak,
@@ -358,8 +358,8 @@ function client_context(listing: ModListing): ClientContext {
},
get_client_data: (x, y, z, field) =>
structuredClone(need_client().level.get_block_data(x, y, z)?.[field]) as never,
biome_at: (x, z) => rules_world.biome_at(x, z),
season_at: (x, z) => rules_world.season_at(x, z),
biome_at: (x, y, z) => rules_world.biome_at(x, y, z),
season_at: (x, y, z) => rules_world.season_at(x, y, z),
get min_y() {
return need_client().level.shape.min_y;
},