summaryrefslogtreecommitdiff
path: root/ihl/worldgen/WorldGeneratorUndergroundLake.java
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2017-04-22 14:31:54 +0300
committerFoghrye4 <foghrye4@gmail.com>2017-04-22 14:31:54 +0300
commitb67ac617dc9c5f43b911158a281c3c61ced5ea5a (patch)
tree649b4553f8b2e673b0c4b12e470feb7e7628de8e /ihl/worldgen/WorldGeneratorUndergroundLake.java
parentaa42aedecd2d2842351088085e8fd9d69ec79565 (diff)
NEI titles translation
Diffstat (limited to 'ihl/worldgen/WorldGeneratorUndergroundLake.java')
-rw-r--r--ihl/worldgen/WorldGeneratorUndergroundLake.java27
1 files changed, 18 insertions, 9 deletions
diff --git a/ihl/worldgen/WorldGeneratorUndergroundLake.java b/ihl/worldgen/WorldGeneratorUndergroundLake.java
index b902efa..7abee8e 100644
--- a/ihl/worldgen/WorldGeneratorUndergroundLake.java
+++ b/ihl/worldgen/WorldGeneratorUndergroundLake.java
@@ -1,8 +1,11 @@
package ihl.worldgen;
import ihl.utils.IHLMathUtils;
+import ihl.utils.IHLUtils;
import net.minecraft.block.Block;
import net.minecraft.world.World;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
public class WorldGeneratorUndergroundLake extends WorldGeneratorBase {
@@ -25,17 +28,23 @@ public class WorldGeneratorUndergroundLake extends WorldGeneratorBase {
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;
+ int absX = ix + startX;
+ int absZ = iz + startZ;
+ int absY = iy;
+ Chunk chunk = world.getChunkFromBlockCoords(absX, absZ);
+ ExtendedBlockStorage ebs = chunk.getBlockStorageArray()[absY >> 4];
+ if (ebs != null && replaceableBlocks.contains(ebs.getBlockByExtId(absX & 15, absY & 15, absZ & 15))) {
+ int[] xyz = new int[] { 0, 0, -1, 0, 0, 1, 0, 0 };
+ for (int i = 2; i < xyz.length; i++) {
+ int absX2 = absX + xyz[i - 2];
+ int absZ2 = absZ + xyz[i];
+ if (!world.getChunkProvider().chunkExists(absX2 >> 4, absZ2 >> 4)) {
+ continue nextZ;
+ }
+ this.replaceAllExceptOre(world, absX2, iy + xyz[i - 1], absZ2, clayBlock);
}
- this.replaceAllExceptOre(world, absX, iy + xyz[i - 1],absZ,
- clayBlock);
+ IHLUtils.setBlockRaw(ebs, absX & 15, absY & 15, absZ & 15, ore);
}
- this.replace(world, ix + startX, iy, iz + startZ, ore);
}
}
if (surroundPOI[2] == z) {