CamoMano / Enriched

Enriched is a mod that adds enhancements and vanilla-esque additions to the game as well as bringing back removed features.
MIT License
7 stars 4 forks source link

Feature Order Cycle crash with WWOO #67

Closed Apollounknowndev closed 1 year ago

Apollounknowndev commented 1 year ago

When this mod is used in conjunction with William Wyther's Overhauled Overworld (and possibly other biome mods as well), the game crashes.

Steps To Reproduce

This is caused due to how Ruby Ore and Sapphire Ore biome modifiers are set up.

if (config.enableRubyOre) {
  BiomeModifications.addFeature(
      BiomeSelectors.foundInOverworld(),
      GenerationStep.Feature.UNDERGROUND_ORES,
      RUBY_ORE_PLACED_KEY);
  BiomeModifications.addFeature(
      BiomeSelectors.tag(IS_SAVANNA),
      GenerationStep.Feature.UNDERGROUND_ORES,
      RUBY_ORE_COMMON_PLACED_KEY);
  BiomeModifications.addFeature(
      BiomeSelectors.tag(IS_BADLANDS),
      GenerationStep.Feature.UNDERGROUND_ORES,
      RUBY_ORE_COMMON_PLACED_KEY);
}
...
if (config.enableSapphireOre) {
  BiomeModifications.addFeature(
      BiomeSelectors.foundInOverworld(),
      GenerationStep.Feature.UNDERGROUND_ORES,
      SAPPHIRE_ORE_PLACED_KEY);
  BiomeModifications.addFeature(
      BiomeSelectors.tag(IS_TAIGA),
      GenerationStep.Feature.UNDERGROUND_ORES,
      SAPPHIRE_ORE_COMMON_PLACED_KEY);
  BiomeModifications.addFeature(
      BiomeSelectors.tag(IS_MOUNTAIN),
      GenerationStep.Feature.UNDERGROUND_ORES,
      SAPPHIRE_ORE_COMMON_PLACED_KEY);
}

If a biome is tagged with both is_savanna and is_badlands, the ruby ore placed feature will be added twice and the game will crash. If a biome is tagged with both is_taiga and is_mountain, the sapphire ore placed feature will be added twice and the game will also crash.

The solution to this is to add two new biome tags to the mod, probably named spawns_ruby_ore and spawns_sapphire_ore. The spawns_ruby_ore tag would include #minecraft:is_savanna and #minecraft:is_badlands, and the spawns_sapphire_ore tag would include #minecraft:is_taiga and #minecraft:is_mountain