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
+11 -8
View File
@@ -663,10 +663,10 @@ export class ModRuntime {
y,
z,
get biome() {
return game.world.biome_at(x, z);
return game.world.biome_at(x, y, z);
},
get season() {
return biome_season(game.world.biome_at(x, z), game.world.time);
return biome_season(game.world.biome_at(x, y, z), game.world.time);
},
get data() {
return game.world.get_tile(x, y, z)?.mod_data;
@@ -942,9 +942,12 @@ export class ModRuntime {
return { x: fx + 0, y: fy + 0, z: fz + 0 };
},
is_loaded: (x, z) => game().world.is_generated(Math.floor(x / CHUNK_SIZE), Math.floor(z / CHUNK_SIZE)),
biome_at: (x, z) => game().world.biome_at(Math.floor(x), Math.floor(z)),
season_at: (x, z) =>
biome_season(game().world.biome_at(Math.floor(x), Math.floor(z)), game().world.time),
biome_at: (x, y, z) => game().world.biome_at(Math.floor(x), Math.floor(y), Math.floor(z)),
season_at: (x, y, z) =>
biome_season(
game().world.biome_at(Math.floor(x), Math.floor(y), Math.floor(z)),
game().world.time,
),
get min_y() {
return game().world.shape.min_y;
},
@@ -1507,7 +1510,7 @@ function player_api(game: GameServer, player: ServerPlayer): Player {
};
},
get biome() {
return game.world.biome_at(Math.floor(player.x), Math.floor(player.z));
return game.world.biome_at(Math.floor(player.x), Math.floor(player.y), Math.floor(player.z));
},
get season() {
return biome_season(this.biome, game.world.time);
@@ -1676,10 +1679,10 @@ export function entity_ref(entity: Entity): EntityRef {
return { x: entity.x, y: entity.y, z: entity.z };
},
get biome() {
return entity.level.biome_at(Math.floor(entity.x), Math.floor(entity.z));
return entity.level.biome_at(Math.floor(entity.x), Math.floor(entity.y), Math.floor(entity.z));
},
get season() {
return entity.level.season_at(Math.floor(entity.x), Math.floor(entity.z));
return entity.level.season_at(Math.floor(entity.x), Math.floor(entity.y), Math.floor(entity.z));
},
get removed() {
return entity.removed;