From 70580e4e6048a314ae18ac8456504dab4ed9f3e3 Mon Sep 17 00:00:00 2001 From: ljcool2006 <51834343+ljcool2006@users.noreply.github.com> Date: Sun, 28 Dec 2025 17:43:06 -0500 Subject: [PATCH 1/5] Update RandomLevelSource.cpp --- .../levelgen/chunk/RandomLevelSource.cpp | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/source/world/level/levelgen/chunk/RandomLevelSource.cpp b/source/world/level/levelgen/chunk/RandomLevelSource.cpp index 5bb234166..f666b6aa9 100644 --- a/source/world/level/levelgen/chunk/RandomLevelSource.cpp +++ b/source/world/level/levelgen/chunk/RandomLevelSource.cpp @@ -378,69 +378,69 @@ void RandomLevelSource::postProcess(ChunkSource* src, const ChunkPos& pos) for (int i = 0; i < 10; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(128), - m_random.nextInt(16)); - ClayFeature(Tile::clay->m_ID, 32).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(128); + int zo = m_random.nextInt(16); + ClayFeature(Tile::clay->m_ID, 32).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } // Start of ore generation for (int i = 0; i < 20; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(128), - m_random.nextInt(16)); - OreFeature(Tile::dirt->m_ID, 32).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(128); + int zo = m_random.nextInt(16); + OreFeature(Tile::dirt->m_ID, 32).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } for (int i = 0; i < 10; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(128), - m_random.nextInt(16)); - OreFeature(Tile::gravel->m_ID, 32).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(128); + int zo = m_random.nextInt(16); + OreFeature(Tile::gravel->m_ID, 32).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } for (int i = 0; i < 20; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(128), - m_random.nextInt(16)); - OreFeature(Tile::coalOre->m_ID, 16).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(128); + int zo = m_random.nextInt(16); + OreFeature(Tile::coalOre->m_ID, 16).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } for (int i = 0; i < 20; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(64), - m_random.nextInt(16)); - OreFeature(Tile::ironOre->m_ID, 8).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(64); + int zo = m_random.nextInt(16); + OreFeature(Tile::ironOre->m_ID, 8).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } for (int i = 0; i < 2; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(32), - m_random.nextInt(16)); - OreFeature(Tile::goldOre->m_ID, 8).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(32); + int zo = m_random.nextInt(16); + OreFeature(Tile::goldOre->m_ID, 8).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } for (int i = 0; i < 8; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(16), - m_random.nextInt(16)); - OreFeature(Tile::redStoneOre->m_ID, 7).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(16); + int zo = m_random.nextInt(16); + OreFeature(Tile::redStoneOre->m_ID, 7).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } for (int i = 0; i < 1; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(16), - m_random.nextInt(16)); - OreFeature(Tile::emeraldOre->m_ID, 7).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(16); + int zo = m_random.nextInt(16); + OreFeature(Tile::emeraldOre->m_ID, 7).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } for (int i = 0; i < 1; i++) { - TilePos o(m_random.nextInt(16), - m_random.nextInt(16) + m_random.nextInt(16), - m_random.nextInt(16)); - OreFeature(Tile::lapisOre->m_ID, 6).place(m_pLevel, &m_random, tp + o); + int xo = m_random.nextInt(16); + int yo = m_random.nextInt(16) + m_random.nextInt(16); + int zo = m_random.nextInt(16); + OreFeature(Tile::lapisOre->m_ID, 6).place(m_pLevel, &m_random, TilePos(tp.x + xo, yo, tp.z + zo)); } // End of ore generation From 6e758654cb30fce676f8ec3dbcc6f8c041b6ca17 Mon Sep 17 00:00:00 2001 From: ljcool2006 <51834343+ljcool2006@users.noreply.github.com> Date: Sun, 28 Dec 2025 17:45:36 -0500 Subject: [PATCH 2/5] Update FlowerFeature.cpp --- source/world/level/levelgen/feature/FlowerFeature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/world/level/levelgen/feature/FlowerFeature.cpp b/source/world/level/levelgen/feature/FlowerFeature.cpp index 9fa2cf1e3..583220717 100644 --- a/source/world/level/levelgen/feature/FlowerFeature.cpp +++ b/source/world/level/levelgen/feature/FlowerFeature.cpp @@ -20,9 +20,9 @@ bool FlowerFeature::place(Level* level, Random* random, const TilePos& pos) for (int i = 0; i < 64; i++) { - tp = TilePos(pos.x + random->nextInt(8) - random->nextInt(8), - pos.y + random->nextInt(4) - random->nextInt(4), - pos.z + random->nextInt(8) - random->nextInt(8)); + tp.x = pos.x + random->nextInt(8) - random->nextInt(8); + tp.y = pos.y + random->nextInt(4) - random->nextInt(4); + tp.z = pos.z + random->nextInt(8) - random->nextInt(8); if (level->isEmptyTile(tp) && Tile::tiles[m_ID]->canSurvive(level, tp)) level->setTileNoUpdate(tp, m_ID); From bcd509991dab94e0ec4e60915cab4895cc6e84f4 Mon Sep 17 00:00:00 2001 From: ljcool2006 <51834343+ljcool2006@users.noreply.github.com> Date: Sun, 28 Dec 2025 17:46:33 -0500 Subject: [PATCH 3/5] Update ReedsFeature.cpp --- source/world/level/levelgen/feature/ReedsFeature.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/world/level/levelgen/feature/ReedsFeature.cpp b/source/world/level/levelgen/feature/ReedsFeature.cpp index fc7ec91bb..13d96e954 100644 --- a/source/world/level/levelgen/feature/ReedsFeature.cpp +++ b/source/world/level/levelgen/feature/ReedsFeature.cpp @@ -11,11 +11,12 @@ bool ReedsFeature::place(Level* level, Random* random, const TilePos& pos) { - TilePos tp; + TilePos tp(pos); for (int i = 0; i < 20; i++) { - tp = TilePos((pos.x + random->nextInt(4)) - random->nextInt(4), pos.y, (pos.z + random->nextInt(4)) - random->nextInt(4)); + tp.x = pos.x + random->nextInt(4) - random->nextInt(4); + tp.z = pos.z + random->nextInt(4) - random->nextInt(4); if (!level->isEmptyTile(tp)) continue; From d7546617d744449aa5bf50ed712abf06c1ff63e5 Mon Sep 17 00:00:00 2001 From: ljcool2006 <51834343+ljcool2006@users.noreply.github.com> Date: Sun, 28 Dec 2025 17:47:44 -0500 Subject: [PATCH 4/5] fix small typo in OreFeature --- source/world/level/levelgen/feature/OreFeature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/world/level/levelgen/feature/OreFeature.cpp b/source/world/level/levelgen/feature/OreFeature.cpp index 1b7ca2596..e530915e2 100644 --- a/source/world/level/levelgen/feature/OreFeature.cpp +++ b/source/world/level/levelgen/feature/OreFeature.cpp @@ -21,7 +21,7 @@ bool OreFeature::place(Level* level, Random* random, const TilePos& pos) float d0 = float(pos.x + 8) + 0.125f * float(m_count) * Mth::sin(fAng); float d1 = float(pos.x + 8) - 0.125f * float(m_count) * Mth::sin(fAng); - float d2 = float(pos.z + 8) - 0.125f * float(m_count) * Mth::cos(fAng); + float d2 = float(pos.z + 8) + 0.125f * float(m_count) * Mth::cos(fAng); float d3 = float(pos.z + 8) - 0.125f * float(m_count) * Mth::cos(fAng); float d4 = float(random->nextInt(3) + pos.y + 2); From 189a7ff48977fe74a2ee2679b19799211d2e5a77 Mon Sep 17 00:00:00 2001 From: ljcool2006 <51834343+ljcool2006@users.noreply.github.com> Date: Sun, 28 Dec 2025 17:48:11 -0500 Subject: [PATCH 5/5] fix small typo in ClayFeature --- source/world/level/levelgen/feature/ClayFeature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/world/level/levelgen/feature/ClayFeature.cpp b/source/world/level/levelgen/feature/ClayFeature.cpp index 4b1faea33..291b76697 100644 --- a/source/world/level/levelgen/feature/ClayFeature.cpp +++ b/source/world/level/levelgen/feature/ClayFeature.cpp @@ -28,7 +28,7 @@ bool ClayFeature::place(Level* level, Random* random, const TilePos& pos) float d0 = float(pos.x + 8) + 0.125f * float(m_count) * Mth::sin(fAng); float d1 = float(pos.x + 8) - 0.125f * float(m_count) * Mth::sin(fAng); - float d2 = float(pos.z + 8) - 0.125f * float(m_count) * Mth::cos(fAng); + float d2 = float(pos.z + 8) + 0.125f * float(m_count) * Mth::cos(fAng); float d3 = float(pos.z + 8) - 0.125f * float(m_count) * Mth::cos(fAng); float d4 = float(pos.y + random->nextInt(3) + 2);