VanillaParameterOverlayBuilder seems to be shifting the points
maityyy opened this issue · 2 comments
What's the issue you encountered?
My goal is to replace Biomes.RIVER with CustomBiomes.GRAVEL_RIVER (in some places). I get Biomes.RIVER placement points and decide to place CustomBiomes.GRAVEL_RIVER on them using VanillaParameterOverlayBuilder
, but for some reason it shifts the points, causing CustomBiomes.GRAVEL_RIVER to be placed not only where Biomes.RIVER should be, but also in other places, which seems to be incorrect behavior.
As you can see, CustomBiomes.GRAVEL_RIVER is placed where Biomes.TAIGA is, although I'm only using Biomes.RIVER points
How can the issue be reproduced?
The code:
var riverPoints = RegionUtils.getVanillaParameterPoints(Biomes.RIVER);
var overlayBuilder = new VanillaParameterOverlayBuilder();
riverPoints.forEach(point -> overlayBuilder.add(point, CustomBiomes.GRAVEL_RIVER));
overlayBuilder.build().forEach(mapper);
Seed:
5030393227310356141
Coordinates:
/tp -250 110 250
Logs
No response
Mod Version
3.5.0.4 for Fabric 1.20.6
Additional information
No response
I decided to check one of the parameters (weirdness) that affects the width of the rivers - VanillaParameterOverlayBuilder
does shift the points. Vanilla: -500 to 500
, custom: 500 to 10000
and -10000 to -500
. I know there is indeed an offset in the code, but as far as I understand it, it's still a bug. Well, this class has pretty bad docs, I'd say no docs at all, so I could be wrong... correct me if I am.
The code:
var riverPoints = RegionUtils.getVanillaParameterPoints(Biomes.RIVER);
var overlayBuilder = new VanillaParameterOverlayBuilder();
riverPoints.forEach(point -> {
overlayBuilder.add(point, CustomBiomes.GRAVEL_RIVER);
System.out.println("before build = " + point.weirdness());
});
overlayBuilder.build().forEach(entry -> {
mapper.accept(entry);
System.out.println("after build = " + entry.getFirst().weirdness());
});
Result:
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
before build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-500-500]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]
after build = [-10000--500]
after build = [500-10000]