Skip to content

Commit

Permalink
Don't melt ice and snow in vanilla biomes that are representations of…
Browse files Browse the repository at this point in the history
… permanent winter

Closes #15
  • Loading branch information
slicedlime committed Jan 3, 2025
1 parent fd5b9fd commit 2160376
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 61 deletions.
36 changes: 29 additions & 7 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
}
}

# Permanently summer: warm_ocean, badlands, desert, eroded_badlands, jungle, sparse jungle, mangrove swamp, wooded_badlands
# Permanently winter: frozen_peaks, ice_spikes, frozen_ocean, deep_frozen_ocean
# ???: Lukewarm ocean, swamps

# Mapping of biomes from vanilla biomes per season
Expand Down Expand Up @@ -162,6 +160,27 @@
}
}

# Always summer - should not get snow, leaves don't turn, etc
always_summer_biomes = [
'warm_ocean',
'badlands',
'desert',
'eroded_badlands',
'jungle',
'sparse_jungle',
'mangrove_swamp',
'wooded_badlands'
]

# Always winter - snow and ice should never melt
always_winter_biomes = [
'frozen_peaks',
'snowy_peaks',
'ice_spikes',
'frozen_ocean',
'deep_frozen_ocean'
]

with open(tag_file) as file:
data = json.load(file)
values = data['values']
Expand Down Expand Up @@ -217,16 +236,19 @@ def write_tag(id: str, biomes: list):
with open(tag_filename, 'w') as file:
json.dump(data, file, indent=4)

def create_tags(id, biome, winter_biomes: list, bare_winter_biomes: list, snowy_biomes: list):
def create_tags(id, biome, can_melt_biomes: list, bare_winter_biomes: list, snowy_biomes: list):
summer_list = [f'seasons:summer/{id}']
fall_list = [f'seasons:fall_early/{id}', f'seasons:fall_late/{id}']
bare_winter_biome = f'seasons:winter_bare/{id}'
winter_list = [bare_winter_biome, f'seasons:winter_snowy/{id}']
melting_list = [f'seasons:winter_melting/{id}']
spring_list = [f'seasons:spring_default/{id}', f'seasons:spring_flowering/{id}']

winter_biomes.extend(winter_list)
bare_winter_biomes.append(bare_winter_biome)
can_melt_biomes.extend(summer_list)
can_melt_biomes.extend(fall_list)
can_melt_biomes.extend(melting_list)
can_melt_biomes.extend(spring_list)

vanilla = []
for season in seasons:
Expand Down Expand Up @@ -447,14 +469,14 @@ def create_biomes(id: str, biome: dict):
else:
raise Exception('Unknown type')

winter_biomes = []
can_melt_biomes = [f'minecraft:{biome}' for biome in always_summer_biomes]
bare_winter_biomes = []
snowy_biomes = []
for id, biome in season_biomes.items():
create_tags(id, biome, winter_biomes, bare_winter_biomes, snowy_biomes)
create_tags(id, biome, can_melt_biomes, bare_winter_biomes, snowy_biomes)
create_biomes(id, biome)

write_tag(f'winter', winter_biomes)
write_tag(f'can_melt', can_melt_biomes)
write_tag(f'bare_winter', bare_winter_biomes)
write_tag(f'snowy', snowy_biomes)

Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Version Beta 0.4
- Fixed a bug causing ice spikes, frozen peaks and other similar permanent winter biomes to melt ([issue 15](https://github.com/slicedlime/seasons/issues/15))

# Version Beta 0.3
- Upgrade to Minecraft 1.21.4
- Add support for the Pale Garden and Cherry Grove biomes
Expand Down
4 changes: 2 additions & 2 deletions data/seasons/function/melt_fast.mcfunction
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
execute if block ~ ~ ~ snow run function seasons:melt_last_snow_layer
execute if block ~ ~ ~ ice run setblock ~ ~ ~ frosted_ice
execute if biome ~ ~ ~ #seasons:can_melt if block ~ ~ ~ snow run function seasons:melt_last_snow_layer
execute if biome ~ ~ ~ #seasons:can_melt if block ~ ~ ~ ice run setblock ~ ~ ~ frosted_ice
2 changes: 1 addition & 1 deletion data/seasons/function/update_non_winter_blocks.mcfunction
Original file line number Diff line number Diff line change
@@ -1 +1 @@
execute positioned ~ ~-1 ~ if block ~ ~ ~ #seasons:meltables run function seasons:melt
execute positioned ~ ~-1 ~ if biome ~ ~ ~ #seasons:can_melt if block ~ ~ ~ #seasons:meltables run function seasons:melt
151 changes: 151 additions & 0 deletions data/seasons/tags/worldgen/biome/can_melt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"replace": false,
"values": [
"minecraft:warm_ocean",
"minecraft:badlands",
"minecraft:desert",
"minecraft:eroded_badlands",
"minecraft:jungle",
"minecraft:sparse_jungle",
"minecraft:mangrove_swamp",
"minecraft:wooded_badlands",
"seasons:summer/beach",
"seasons:fall_early/beach",
"seasons:fall_late/beach",
"seasons:winter_melting/beach",
"seasons:spring_default/beach",
"seasons:spring_flowering/beach",
"seasons:summer/birch_forest",
"seasons:fall_early/birch_forest",
"seasons:fall_late/birch_forest",
"seasons:winter_melting/birch_forest",
"seasons:spring_default/birch_forest",
"seasons:spring_flowering/birch_forest",
"seasons:summer/ocean",
"seasons:fall_early/ocean",
"seasons:fall_late/ocean",
"seasons:winter_melting/ocean",
"seasons:spring_default/ocean",
"seasons:spring_flowering/ocean",
"seasons:summer/cherry_grove",
"seasons:fall_early/cherry_grove",
"seasons:fall_late/cherry_grove",
"seasons:winter_melting/cherry_grove",
"seasons:spring_default/cherry_grove",
"seasons:spring_flowering/cherry_grove",
"seasons:summer/dark_forest",
"seasons:fall_early/dark_forest",
"seasons:fall_late/dark_forest",
"seasons:winter_melting/dark_forest",
"seasons:spring_default/dark_forest",
"seasons:spring_flowering/dark_forest",
"seasons:summer/deep_ocean",
"seasons:fall_early/deep_ocean",
"seasons:fall_late/deep_ocean",
"seasons:winter_melting/deep_ocean",
"seasons:spring_default/deep_ocean",
"seasons:spring_flowering/deep_ocean",
"seasons:summer/flower_forest",
"seasons:fall_early/flower_forest",
"seasons:fall_late/flower_forest",
"seasons:winter_melting/flower_forest",
"seasons:spring_default/flower_forest",
"seasons:spring_flowering/flower_forest",
"seasons:summer/forest",
"seasons:fall_early/forest",
"seasons:fall_late/forest",
"seasons:winter_melting/forest",
"seasons:spring_default/forest",
"seasons:spring_flowering/forest",
"seasons:summer/peaks",
"seasons:fall_early/peaks",
"seasons:fall_late/peaks",
"seasons:winter_melting/peaks",
"seasons:spring_default/peaks",
"seasons:spring_flowering/peaks",
"seasons:summer/river",
"seasons:fall_early/river",
"seasons:fall_late/river",
"seasons:winter_melting/river",
"seasons:spring_default/river",
"seasons:spring_flowering/river",
"seasons:summer/grove",
"seasons:fall_early/grove",
"seasons:fall_late/grove",
"seasons:winter_melting/grove",
"seasons:spring_default/grove",
"seasons:spring_flowering/grove",
"seasons:summer/meadow",
"seasons:fall_early/meadow",
"seasons:fall_late/meadow",
"seasons:winter_melting/meadow",
"seasons:spring_default/meadow",
"seasons:spring_flowering/meadow",
"seasons:summer/mushroom_fields",
"seasons:fall_early/mushroom_fields",
"seasons:fall_late/mushroom_fields",
"seasons:winter_melting/mushroom_fields",
"seasons:spring_default/mushroom_fields",
"seasons:spring_flowering/mushroom_fields",
"seasons:summer/old_growth_birch_forest",
"seasons:fall_early/old_growth_birch_forest",
"seasons:fall_late/old_growth_birch_forest",
"seasons:winter_melting/old_growth_birch_forest",
"seasons:spring_default/old_growth_birch_forest",
"seasons:spring_flowering/old_growth_birch_forest",
"seasons:summer/old_growth_pine_taiga",
"seasons:fall_early/old_growth_pine_taiga",
"seasons:fall_late/old_growth_pine_taiga",
"seasons:winter_melting/old_growth_pine_taiga",
"seasons:spring_default/old_growth_pine_taiga",
"seasons:spring_flowering/old_growth_pine_taiga",
"seasons:summer/old_growth_spruce_taiga",
"seasons:fall_early/old_growth_spruce_taiga",
"seasons:fall_late/old_growth_spruce_taiga",
"seasons:winter_melting/old_growth_spruce_taiga",
"seasons:spring_default/old_growth_spruce_taiga",
"seasons:spring_flowering/old_growth_spruce_taiga",
"seasons:summer/pale_garden",
"seasons:fall_early/pale_garden",
"seasons:fall_late/pale_garden",
"seasons:winter_melting/pale_garden",
"seasons:spring_default/pale_garden",
"seasons:spring_flowering/pale_garden",
"seasons:summer/plains",
"seasons:fall_early/plains",
"seasons:fall_late/plains",
"seasons:winter_melting/plains",
"seasons:spring_default/plains",
"seasons:spring_flowering/plains",
"seasons:summer/savanna",
"seasons:fall_early/savanna",
"seasons:fall_late/savanna",
"seasons:winter_melting/savanna",
"seasons:spring_default/savanna",
"seasons:spring_flowering/savanna",
"seasons:summer/savanna_plateau",
"seasons:fall_early/savanna_plateau",
"seasons:fall_late/savanna_plateau",
"seasons:winter_melting/savanna_plateau",
"seasons:spring_default/savanna_plateau",
"seasons:spring_flowering/savanna_plateau",
"seasons:summer/taiga",
"seasons:fall_early/taiga",
"seasons:fall_late/taiga",
"seasons:winter_melting/taiga",
"seasons:spring_default/taiga",
"seasons:spring_flowering/taiga",
"seasons:summer/stony_shore",
"seasons:fall_early/stony_shore",
"seasons:fall_late/stony_shore",
"seasons:winter_melting/stony_shore",
"seasons:spring_default/stony_shore",
"seasons:spring_flowering/stony_shore",
"seasons:summer/windswept_hills",
"seasons:fall_early/windswept_hills",
"seasons:fall_late/windswept_hills",
"seasons:winter_melting/windswept_hills",
"seasons:spring_default/windswept_hills",
"seasons:spring_flowering/windswept_hills"
]
}
51 changes: 0 additions & 51 deletions data/seasons/tags/worldgen/biome/winter.json

This file was deleted.

0 comments on commit 2160376

Please sign in to comment.