question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

foundInOverworld, foundInNether, foundInEnd helper methods are not safe for modded biome sources

See original GitHub issue

All of Fabric team noticed that most modded ores will not spawn in BYG biomes. BYG is using Terrablender. Terrablender uses its own biome source. And Fabric API is using a field that’s very specific to the vanilla overworld biome source which is bad for mod compat and is breaking modpacks using Terrablender. Instead, Fabric API should be using the overworld’s biome source’s possibleBiomes field that they hold always which should have all biomes that can actually spawn in overworld. Or ideally, use the existing minecraft:is_overworld biome tag instead. This change should also be done for the nether and end helpers as well so all three helper methods functions properly regardless of the biome source used for the dimension.

https://github.com/FabricMC/fabric/blob/93d8cb82e85c3d5744716430516daef393cf5815/fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeSelectors.java#L68-L92

These helpers seem to have issues as a somewhat similar issue happened in the past: https://github.com/FabricMC/fabric/issues/1703

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sharttecommented, Nov 3, 2022

Well it says specifically “assuming Vanilla’s default biome source is used.”. Since when these methods were created, it wasn’t really possible to do otherwise.

warjort is completely right.

To correct myself here by the way: The javadoc is actually incorrect. The method uses the real biome source used by the currently loading world, not just the Vanilla one.

1reaction
kwpughcommented, Nov 3, 2022

Hi, sorry to randomly inject, but I’m updating my mods from 22w43a to 22w44a and I wanted to confirm that I am using the correct method to inject my ores into biomes correctly. I was getting a little confused about the discussion.

My code currently:

` public static void addOres() { // Inject into Biomes BiomeModifications.addFeature(overworldSelector(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Gobber2.MOD_ID, “ore_lucky_block_overworld”))); BiomeModifications.addFeature(overworldSelector(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Gobber2.MOD_ID, “ore_gobber_overworld”))); BiomeModifications.addFeature(netherSelector(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Gobber2.MOD_ID, “ore_lucky_block_nether”))); BiomeModifications.addFeature(netherSelector(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Gobber2.MOD_ID, “ore_gobber_nether”))); BiomeModifications.addFeature(endSelector(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Gobber2.MOD_ID, “ore_lucky_block_end”))); BiomeModifications.addFeature(endSelector(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(Gobber2.MOD_ID, “ore_gobber_end”))); }

public static Predicate<BiomeSelectionContext> overworldSelector()
{
    return context -> context.getBiomeRegistryEntry().isIn(BiomeTags.IS_OVERWORLD);
}

public static Predicate<BiomeSelectionContext> netherSelector()
{
    return context -> context.getBiomeRegistryEntry().isIn(BiomeTags.IS_NETHER);
}

public static Predicate<BiomeSelectionContext> endSelector()
{
    return context -> context.getBiomeRegistryEntry().isIn(BiomeTags.IS_END);
}

`

Read more comments on GitHub >

github_iconTop Results From Across the Web

fabric - bytemeta
Indigo fallback consumer does not respect BlendMode or emissivity ... foundInOverworld, foundInNether, foundInEnd helper methods are not safe for modded ...
Read more >
FabricMC Fabric Issues - IssueHint
foundInOverworld, foundInNether, foundInEnd helper methods are not safe for modded biome sources, closed, 8, 2022-11-03, 2022-11-23.
Read more >
Define best practices for handling errors in chaincode
This kind of text error is not good practice and makes error handling in client applications more difficult. As if to prove the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found