Seasons based on a calendar
This commit is contained in:
@@ -510,7 +510,7 @@ export class ModRuntime {
|
||||
return game.world.biome_at(x, z);
|
||||
},
|
||||
get season() {
|
||||
return biome_season(game.world.biome_at(x, z));
|
||||
return biome_season(game.world.biome_at(x, z), game.world.time);
|
||||
},
|
||||
get data() {
|
||||
return game.world.get_tile(x, y, z)?.mod_data;
|
||||
@@ -714,7 +714,8 @@ export class ModRuntime {
|
||||
},
|
||||
is_loaded: () => true,
|
||||
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))),
|
||||
season_at: (x, z) =>
|
||||
biome_season(game().world.biome_at(Math.floor(x), Math.floor(z)), game().world.time),
|
||||
get seed() {
|
||||
return game().world.seed;
|
||||
},
|
||||
@@ -1205,7 +1206,7 @@ function player_api(game: GameServer, player: ServerPlayer): Player {
|
||||
return game.world.biome_at(Math.floor(player.x), Math.floor(player.z));
|
||||
},
|
||||
get season() {
|
||||
return biome_season(this.biome);
|
||||
return biome_season(this.biome, game.world.time);
|
||||
},
|
||||
inventory,
|
||||
get selected_slot() {
|
||||
@@ -1338,7 +1339,7 @@ export function entity_ref(entity: Entity): EntityRef {
|
||||
return entity.level.biome_at(Math.floor(entity.x), Math.floor(entity.z));
|
||||
},
|
||||
get season() {
|
||||
return biome_season(this.biome);
|
||||
return entity.level.season_at(Math.floor(entity.x), Math.floor(entity.z));
|
||||
},
|
||||
get removed() {
|
||||
return entity.removed;
|
||||
|
||||
Reference in New Issue
Block a user