Skip to content

Commit

Permalink
maple tree generation updated
Browse files Browse the repository at this point in the history
  • Loading branch information
kismama committed Jul 17, 2024
1 parent 85ac7ba commit 79f0ec1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/world/worldgen/OverworldChunkGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,31 @@ public Random getRandom(ChunkCoord coord) {
private void placeTree(int x, int y, int z) {
var world = generator.world;
// tree
for (int i = 0; i <= 6; i++) {
for (int i = 0; i <= 7; i++) {
world.setBlock(x, y + i, z, Blocks.MAPLELOG.id);
}
// leaves, bottom
world.setBlock(x - 1, y + 3, z, Blocks.MAPLELEAVES.id);
world.setBlock(x + 1, y + 3, z, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 3, z - 1, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 3, z + 1, Blocks.MAPLELEAVES.id);
world.setBlock(x - 1, y + 6, z, Blocks.MAPLELEAVES.id);
world.setBlock(x + 1, y + 6, z, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 6, z - 1, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 6, z + 1, Blocks.MAPLELEAVES.id);
world.setBlock(x - 1, y + 4, z, Blocks.MAPLELEAVES.id);
world.setBlock(x + 1, y + 4, z, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 4, z - 1, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 4, z + 1, Blocks.MAPLELEAVES.id);
world.setBlock(x - 1, y + 7, z, Blocks.MAPLELEAVES.id);
world.setBlock(x + 1, y + 7, z, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 7, z - 1, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 7, z + 1, Blocks.MAPLELEAVES.id);
// leaves, thick
for (int x1 = -1; x1 <= 1; x1++) {
for (int z1 = -1; z1 <= 1; z1++) {
// don't overwrite the trunk
if (x1 == 0 && z1 == 0) {
continue;
}
for (int y1 = 4; y1 <= 5; y1++) {
for (int y1 = 5; y1 <= 6; y1++) {
world.setBlock(x + x1, y + y1, z + z1, Blocks.MAPLELEAVES.id);
}
}
}

world.setBlock(x, y + 7, z, Blocks.MAPLELEAVES.id);
world.setBlock(x, y + 8, z, Blocks.MAPLELEAVES.id);
}
}

0 comments on commit 79f0ec1

Please sign in to comment.