Skip to content

Commit b26105d

Browse files
committed
fix: fix surface populator only generates in one of the chunk quadrants.
1 parent 3fc7f42 commit b26105d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/main/java/gregtech/api/worldgen/populator/SurfaceBlockPopulator.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ public void populateChunk(World world, int chunkX, int chunkZ, Random random, Or
5757
GridEntryInfo gridEntryInfo) {
5858
int stonesCount = minIndicatorAmount + (minIndicatorAmount >= maxIndicatorAmount ? 0 :
5959
random.nextInt(maxIndicatorAmount - minIndicatorAmount));
60+
61+
int baseX = chunkX * 16 + 8;
62+
int baseZ = chunkZ * 16 + 8;
63+
6064
if (stonesCount > 0 && world.getWorldType() != WorldType.FLAT) {
6165
for (int i = 0; i < stonesCount; i++) {
62-
int randomX = chunkX * 16 + random.nextInt(8);
63-
int randomZ = chunkZ * 16 + random.nextInt(8);
66+
int randomX = baseX + random.nextInt(16);
67+
int randomZ = baseZ + random.nextInt(16);
6468

6569
boolean successful = generateSurfaceBlock(world, new BlockPos(randomX, 0, randomZ));
6670

src/main/java/gregtech/api/worldgen/populator/SurfaceRockPopulator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public void populateChunk(World world, int chunkX, int chunkZ, Random random, Or
9999
int baseZ = chunkZ * 16 + 8;
100100

101101
for (int i = 0; i < stonesCount; i++) {
102-
int randomX = baseX + random.nextInt(8);
103-
int randomZ = baseZ + random.nextInt(8);
102+
int randomX = baseX + random.nextInt(16);
103+
int randomZ = baseZ + random.nextInt(16);
104104

105105
generateSurfaceRock(world, new BlockPos(randomX, 0, randomZ));
106106

0 commit comments

Comments
 (0)