mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-27 22:10:46 +00:00
format everything
This commit is contained in:
@@ -37,11 +37,11 @@ bool TreeFeature::place(Level* level, Random* random, int x, int y, int z) {
|
||||
// 4J Stu Added to stop tree features generating areas previously place by
|
||||
// game rule generation
|
||||
if (app.getLevelGenerationOptions() != nullptr) {
|
||||
LevelGenerationOptions* levelGenOptions =
|
||||
LevelGenerationOptions* levelGenOptions =
|
||||
app.getLevelGenerationOptions();
|
||||
bool intersects = levelGenOptions->checkIntersects(
|
||||
x - 2, y - 1, z - 2, x + 2, y + treeHeight, z + 2);
|
||||
|
||||
|
||||
if (intersects) {
|
||||
// app.DebugPrintf("Skipping reeds feature generation as it overlaps
|
||||
// a game rule structure\n");
|
||||
@@ -77,7 +77,7 @@ bool TreeFeature::place(Level* level, Random* random, int x, int y, int z) {
|
||||
|
||||
placeBlock(level, x, y - 1, z, Tile::dirt_Id, 0);
|
||||
|
||||
int grassHeight = 3;
|
||||
int grassHeight = 3;
|
||||
int extraWidth = 0;
|
||||
// 4J Stu - Generate leaves from the top down to stop having to recalc
|
||||
// heightmaps
|
||||
@@ -97,8 +97,8 @@ bool TreeFeature::place(Level* level, Random* random, int x, int y, int z) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int hh = 0; hh < treeHeight; hh++) {
|
||||
|
||||
for (int hh = 0; hh < treeHeight; hh++) {
|
||||
int t = level->getTile(x, y + hh, z);
|
||||
if (t == 0 || t == Tile::leaves_Id) {
|
||||
placeBlock(level, x, y + hh, z, Tile::treeTrunk_Id, trunkType);
|
||||
@@ -126,9 +126,9 @@ bool TreeFeature::place(Level* level, Random* random, int x, int y, int z) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (addJungleFeatures) {
|
||||
for (int yy = y - 3 + treeHeight; yy <= y + treeHeight; yy++) {
|
||||
for (int yy = y - 3 + treeHeight; yy <= y + treeHeight; yy++) {
|
||||
int yo = yy - (y + treeHeight);
|
||||
int offs = 2 - yo / 2;
|
||||
for (int xx = x - offs; xx <= x + offs; xx++) {
|
||||
@@ -156,10 +156,10 @@ bool TreeFeature::place(Level* level, Random* random, int x, int y, int z) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// also chance for cocoa plants around stem
|
||||
if (random->nextInt(5) == 0 && treeHeight > 5) {
|
||||
for (int rows = 0; rows < 2; rows++) {
|
||||
for (int rows = 0; rows < 2; rows++) {
|
||||
for (int dir = 0; dir < 4; dir++) {
|
||||
if (random->nextInt(4 - rows) == 0) {
|
||||
int age = random->nextInt(3);
|
||||
@@ -173,7 +173,6 @@ bool TreeFeature::place(Level* level, Random* random, int x, int y, int z) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user