Fix leaves spawning near 0,0,0

This commit is contained in:
mezz committed 2017-06-04 13:34:59 -07:00
1 parent f569a04797
commit a3c79c0427
4 files changed
+5 -5

No files matched your search

@@ -60,7 +60,7 @@ public class WorldGenBaobab extends WorldGenTree {
int x_off = -girth + rand.nextInt(2 * girth);
int y_off = -girth + rand.nextInt(2 * girth);
BlockPos center = new BlockPos(x_off, h, y_off);
BlockPos center = startPos.add(x_off, h, y_off);
int radius = 1;
if (girth > 1) {
radius += rand.nextInt(girth - 1);
@@ -78,7 +78,7 @@ public class WorldGenBaobab extends WorldGenTree {
int x_off = -1 + rand.nextInt(3);
int y_off = -1 + rand.nextInt(3);
BlockPos center = new BlockPos(x_off, h, y_off);
BlockPos center = startPos.add(x_off, h, y_off);
int radius = 1 + rand.nextInt(2);
WorldGenHelper.generateSphere(world, center, radius, leaf, WorldGenHelper.EnumReplaceMode.AIR);
}
@@ -56,7 +56,7 @@ public class WorldGenGreenheart extends WorldGenTree {
}
int x_off = -1 + rand.nextInt(3);
int y_off = -1 + rand.nextInt(3);
WorldGenHelper.generateSphere(world, new BlockPos(x_off, h, y_off), 1 + rand.nextInt(1), leaf, WorldGenHelper.EnumReplaceMode.AIR);
WorldGenHelper.generateSphere(world, startPos.add(x_off, h, y_off), 1 + rand.nextInt(1), leaf, WorldGenHelper.EnumReplaceMode.AIR);
}
}
}
@@ -63,7 +63,7 @@ public class WorldGenKapok extends WorldGenTree {
}
int x_off = -1 + rand.nextInt(3);
int y_off = -1 + rand.nextInt(3);
WorldGenHelper.generateSphere(world, new BlockPos(x_off, h, y_off), 1 + rand.nextInt(1), leaf, WorldGenHelper.EnumReplaceMode.AIR);
WorldGenHelper.generateSphere(world, startPos.add(x_off, h, y_off), 1 + rand.nextInt(1), leaf, WorldGenHelper.EnumReplaceMode.AIR);
}
}
}
@@ -46,6 +46,6 @@ public class WorldGenMahoe extends WorldGenTree {
int yCenter = height - girth;
yCenter = yCenter > 3 ? yCenter : 4;
WorldGenHelper.generateSphereFromTreeStartPos(world, new BlockPos(0, yCenter, 0), girth, 3 + rand.nextInt(girth), leaf, WorldGenHelper.EnumReplaceMode.AIR);
WorldGenHelper.generateSphereFromTreeStartPos(world, startPos.add(0, yCenter, 0), girth, 3 + rand.nextInt(girth), leaf, WorldGenHelper.EnumReplaceMode.AIR);
}
}