diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2017-03-21 17:34:07 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2017-03-21 17:34:07 +0300 |
| commit | 7305ba719930ea3fbf8aa987aeec48b33cdbd82e (patch) | |
| tree | 2307517925d965cd9228c8649013b07639987846 /ihl/worldgen/WorldGeneratorUndergroundLake.java | |
| parent | 5cb4c6e24033cf337812390d99a6817d24d21eab (diff) | |
Oregen
Diffstat (limited to 'ihl/worldgen/WorldGeneratorUndergroundLake.java')
| -rw-r--r-- | ihl/worldgen/WorldGeneratorUndergroundLake.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ihl/worldgen/WorldGeneratorUndergroundLake.java b/ihl/worldgen/WorldGeneratorUndergroundLake.java new file mode 100644 index 0000000..6cd0870 --- /dev/null +++ b/ihl/worldgen/WorldGeneratorUndergroundLake.java @@ -0,0 +1,39 @@ +package ihl.worldgen; + +import ihl.utils.IHLMathUtils; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class WorldGeneratorUndergroundLake extends WorldGeneratorBase { + + private final Block clayBlock; + + public WorldGeneratorUndergroundLake(Block oreIn, Block clayIn, Block[] replaceableBlocksIn) { + super(oreIn, replaceableBlocksIn); + clayBlock = clayIn; + } + + @Override + protected void replaceBlocks(World world, int[] centralPOI, int[] surroundPOI, int startX, int startZ) { + 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)) { + y2 += IHLMathUtils.sign(surroundPOI[1] - world.getActualHeight() / 4 - y2); + if (y2 > 1) { + this.replace(world, ix + startX, y2 + 1, iz + startZ, clayBlock); + for (int iy = y2; iy > 0; iy--) { + this.replace(world, ix + startX, iy, iz + startZ, ore); + } + } + if (surroundPOI[2] == z) { + break; + } + } + if (surroundPOI[0] == x) { + break; + } + } + } + +} |
