Skip to content

Commit 589701b

Browse files
committed
Fix terrain generation on large biomes
1 parent 7cd2ae4 commit 589701b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/main/c/cubiomes

src/main/java/dev/xpple/seedmapper/command/commands/HighlightCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ private static int highlightTerrain(CustomClientCommandSource source, int chunkR
253253
throw CommandExceptions.INVALID_DIMENSION_EXCEPTION.create();
254254
}
255255
int version = source.getVersion();
256+
int generatorFlags = source.getGeneratorFlags();
256257

257258
ChunkPos center = new ChunkPos(BlockPos.containing(source.getPosition()));
258259
int minChunkX = center.x - chunkRange;
@@ -266,7 +267,7 @@ private static int highlightTerrain(CustomClientCommandSource source, int chunkR
266267

267268
try (Arena arena = Arena.ofConfined()) {
268269
MemorySegment params = TerrainNoiseParameters.allocate(arena);
269-
if (Cubiomes.initTerrainNoise(params, seed.seed(), version) == 0) {
270+
if (Cubiomes.initTerrainNoise(params, seed.seed(), version, generatorFlags & Cubiomes.LARGE_BIOMES()) == 0) {
270271
throw CommandExceptions.INCOMPATIBLE_PARAMETERS_EXCEPTION.create();
271272
}
272273

src/main/java/dev/xpple/seedmapper/command/commands/SampleCommand.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ private static int sampleAll(CustomClientCommandSource source) throws CommandSyn
3737
throw CommandExceptions.INVALID_DIMENSION_EXCEPTION.create();
3838
}
3939
int version = source.getVersion();
40+
int generatorFlags = source.getGeneratorFlags();
4041

4142
BlockPos pos = BlockPos.containing(source.getPosition());
4243

4344
try (Arena arena = Arena.ofConfined()) {
4445
MemorySegment params = TerrainNoiseParameters.allocate(arena);
45-
if (Cubiomes.initTerrainNoise(params, seed.seed(), version) == 0) {
46+
if (Cubiomes.initTerrainNoise(params, seed.seed(), version, generatorFlags & Cubiomes.LARGE_BIOMES()) == 0) {
4647
throw CommandExceptions.INCOMPATIBLE_PARAMETERS_EXCEPTION.create();
4748
}
4849

@@ -62,12 +63,13 @@ private static int sampleDensity(CustomClientCommandSource source, DensityFuncti
6263
throw CommandExceptions.INVALID_DIMENSION_EXCEPTION.create();
6364
}
6465
int version = source.getVersion();
66+
int generatorFlags = source.getGeneratorFlags();
6567

6668
BlockPos pos = BlockPos.containing(source.getPosition());
6769

6870
try (Arena arena = Arena.ofConfined()) {
6971
MemorySegment params = TerrainNoiseParameters.allocate(arena);
70-
Cubiomes.initTerrainNoise(params, seed.seed(), version);
72+
Cubiomes.initTerrainNoise(params, seed.seed(), version, generatorFlags & Cubiomes.LARGE_BIOMES());
7173
double density = densityFunction.compute(params, pos.getX(), pos.getY(), pos.getZ());
7274
source.sendFeedback(Component.translatable("command.sample.sampleDensity.success", ComponentUtils.formatXYZ(pos.getX(), pos.getY(), pos.getZ()), ComponentUtils.formatNumber(density)));
7375

0 commit comments

Comments
 (0)