Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions source/world/level/levelgen/chunk/RandomLevelSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/world/level/levelgen/feature/ClayFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions source/world/level/levelgen/feature/FlowerFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source/world/level/levelgen/feature/OreFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions source/world/level/levelgen/feature/ReedsFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down