Hi
public class RangePlacement extends SimplePlacement<TopSolidRangeConfig> {
public RangePlacement(Codec<TopSolidRangeConfig> codec) {
super(codec);
}
public Stream<BlockPos> getPositions(Random random, TopSolidRangeConfig config, BlockPos pos) {
int i = pos.getX();
int j = pos.getZ();
int k = random.nextInt(config.maximum - config.topOffset) + config.bottomOffset;
return Stream.of(new BlockPos(i, k, j));
}
}
Beats me why they found it necessary to have both config.maximum and config.topOffset in there. Probably it means something, eg maximum is the highest y value of this feature but don't use the topmost topOffset rows.
TopSolidRangeConfig(int bottomOffset, int topOffset, int maximum)
means (5, 0, 37) gives you nextInt(37 - 0) + 5 = 5 to 41 inclusive
and (5,10, 37) gives you nextint(37 - 10) + 5 = 5 to 31 inclusive
-TGG