summaryrefslogtreecommitdiff
path: root/ihl/worldgen/WorldGeneratorUndergroundLake.java
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2017-04-05 20:41:13 +0300
committerFoghrye4 <foghrye4@gmail.com>2017-04-05 20:41:13 +0300
commit5b9935f737c226847e668bde0185adbc6a5a8b7b (patch)
tree980cdbadd8635bcd48aa67966c7cceef4677ca64 /ihl/worldgen/WorldGeneratorUndergroundLake.java
parentcd9b5adda974ad9a5e5732fe645571907313b38d (diff)
some experiments
Diffstat (limited to 'ihl/worldgen/WorldGeneratorUndergroundLake.java')
-rw-r--r--ihl/worldgen/WorldGeneratorUndergroundLake.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/ihl/worldgen/WorldGeneratorUndergroundLake.java b/ihl/worldgen/WorldGeneratorUndergroundLake.java
index 6cd0870..b902efa 100644
--- a/ihl/worldgen/WorldGeneratorUndergroundLake.java
+++ b/ihl/worldgen/WorldGeneratorUndergroundLake.java
@@ -18,11 +18,23 @@ public class WorldGeneratorUndergroundLake extends WorldGeneratorBase {
int x = centralPOI[0], y = centralPOI[1] - world.getActualHeight() / 4, z = centralPOI[2];
for (int ix = x; ix < 16 && ix >= 0; ix += IHLMathUtils.sign(surroundPOI[0] - x)) {
int y2 = y += IHLMathUtils.sign(surroundPOI[1] - world.getActualHeight() / 4 - y);
- for (int iz = z; iz < 16 && iz >= 0; iz += IHLMathUtils.sign(surroundPOI[2] - z)) {
+ nextZ:for (int iz = z; iz < 16 && iz >= 0; iz += IHLMathUtils.sign(surroundPOI[2] - z)) {
y2 += IHLMathUtils.sign(surroundPOI[1] - world.getActualHeight() / 4 - y2);
- if (y2 > 1) {
- this.replace(world, ix + startX, y2 + 1, iz + startZ, clayBlock);
+ int dx = ix - x;
+ int dz = iz - z;
+ int d = dx * dx + dz * dz;
+ if (y2 > 1 && d < 64) {
for (int iy = y2; iy > 0; iy--) {
+ int[] xyz = new int[] { 0, 0, -1, 0, 0, 1, 0, 0 };
+ for (int i = 2; i < xyz.length; i++) {
+ int absX = ix + startX + xyz[i - 2];
+ int absZ = iz + startZ + xyz[i];
+ if(!world.getChunkProvider().chunkExists(absX >> 4, absZ >> 4)) {
+ continue nextZ;
+ }
+ this.replaceAllExceptOre(world, absX, iy + xyz[i - 1],absZ,
+ clayBlock);
+ }
this.replace(world, ix + startX, iy, iz + startZ, ore);
}
}