Glitchfiend / TerraBlender

TerraBlender is a library mod for adding biomes in a simple and compatible manner with Minecraft's new biome/terrain system.
https://www.curseforge.com/minecraft/mc-mods/terrablender
GNU Lesser General Public License v3.0
92 stars 30 forks source link

"Vanilla target called on TBNoiseSampler!" can still get thrown under certain circumstances #33

Closed SmellyModder closed 2 years ago

SmellyModder commented 2 years ago

What's the issue you encountered?

This commit https://github.com/Glitchfiend/TerraBlender/commit/79e8452f65e1b36427c7e6b89c140cf869ee8ef3 claims to have fixed compatibility TargetPoint sampling issues, but this is not entirely right. Vanilla's Climate.Sampler#sample() method can potentially get used in the ChunkAccess.fillBiomesFromNoise() method because a mod may seek to use it in a BiomeSource instance. As seen here in TBNoiseBasedChunkGenerator, a new TBClimate.Sampler instance gets created that does not provide the same compatibility-safe sample() method that TBNoiseSampler has. https://github.com/Glitchfiend/TerraBlender/blob/10f350a5b02bedd2ef383cd7738cc7bfcc8f1232/Common/src/main/java/terrablender/worldgen/TBNoiseBasedChunkGenerator.java#L99

The simplest and safest solution here is to make TBClimate.Sampler use the same implementation of sample() that TBNoiseSampler does.

How can the issue be reproduced?

Mods seeking to use the Climate.Sampler#sample() in a custom BiomeSource are at risk of breaking with Terrablender.

Logs

No response

Mod Version

1.18.1

Additional information

No response

Adubbz commented 2 years ago

Closing this as it is fixed/no longer applies to 1.18.2.