Biomes O' Plenty

Biomes O' Plenty

152M Downloads

[1.16.3] Biome o Plenty's biome provider not using biomes from the dynamic registry (hurts mod compat greatly)

TelepathicGrunt opened this issue ยท 3 comments

commented

I gotten a bug report that my mod, Repurposed Structures, cannot spawn any structure when BoP is on. I add my structure to biomes using the BiomeLoadEvent like so here:
https://github.com/TelepathicGrunt/RepurposedStructures/blob/c9dc0b052957d40234f5c23ed8e439bb3aa01b1f/src/main/java/com/telepathicgrunt/repurposedstructures/RepurposedStructures.java#L137-L146

However, as I am debugging, it is firing and adding structures to the biomes upon world create. Except when I go to locate, it is going into the biome provider and saying none of the biomes that the biome provider is holding in its list has the structure.

My suspicion is it is this list that is the issue.

super(Stream.concat(VANILLA_POSSIBLE_BIOMES.stream(), BOPClimates.getOverworldBiomes().stream()).map(BiomeUtil::getBiome).collect(Collectors.toList()));

This is where this get tricky. There's two biome registries in mc right now. The builtin registry and the dynamic registry. When you register and make biomes by code, you store it in the builtin registry and hold that instance of the biome. However, when you make or enter a world, Minecraft takes the biomes, makes a deep copy of them, and stuffs them into a dynamic registry which then reads datapacks to make even more biomes or overwrite the copied biomes. This dynamic registry of biomes is when the forge biome event is fired I believe and is the place where you want to grab biomes from. The Plains biome you hold in that list in the biome provider is not the same Plains as the one in the the dynamic registry that is in the Registry biomes.

Ideally, the solution would be to instead, stream the biomes registry passed in and get a list of biomes by feeding it registrykeys/resourcelocations of the biomes you want. It's ugly but that seems to be what needs to be done to make BoP support the BiomeLoadEvent that everyone is using now and also allow datapacks to override biomes properly.

I hope this helps tho!

commented

Actually I see, You could change the BiomeUtil::getBiome to biomeRegistry::get here and the issue should be resolved.

super(Stream.concat(VANILLA_POSSIBLE_BIOMES.stream(), BOPClimates.getOverworldBiomes().stream()).map(BiomeUtil::getBiome).collect(Collectors.toList()));

Would need to be tested first

commented

This is possibly causing a compatibility issue in CraftPresence as well from testing in https://gitlab.com/CDAGaming/CraftPresence/-/issues/77

commented

Closed with f450200