TerraBlender (Fabric)

TerraBlender (Fabric)

19M Downloads

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

SmellyModder opened this issue ยท 1 comments

commented

What's the issue you encountered?

This commit 79e8452 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.

chunkAccess.fillBiomesFromNoise(biomeresolver, (TBClimate.Sampler)(x, y, z) -> ((TBNoiseSampler)TBNoiseBasedChunkGenerator.this.sampler).targetTB(x, y, z, noiseChunk.noiseDataTB(x, z)));

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

commented

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