From bb1907c6725f50b0d33bd6656b1b85168800348b Mon Sep 17 00:00:00 2001 From: Robijnvogel Date: Sat, 7 Apr 2018 15:01:28 +0200 Subject: [PATCH] Fixed gateways generating half of themselves 48 blocks lower -Fixed length and height being swapped in Cubic Chunks Schematic Placement (stumbled upon this -Fixed gateways partially generating at y level 16 if the (cubic) chunk they *should* be in was totally empty / 100% air (storage = null), because yBase wasn't taken into account. --- src/main/java/org/dimdev/ddutils/schem/Schematic.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/dimdev/ddutils/schem/Schematic.java b/src/main/java/org/dimdev/ddutils/schem/Schematic.java index 575f347c..e7400c09 100644 --- a/src/main/java/org/dimdev/ddutils/schem/Schematic.java +++ b/src/main/java/org/dimdev/ddutils/schem/Schematic.java @@ -399,8 +399,8 @@ public class Schematic { DimDoors.log.info("Setting cube blockstates"); ICubicWorld cubicWorld = (ICubicWorld) world; for (int cubeX = 0; cubeX <= (width >> 4) + 1; cubeX++) { - for (int cubeY = 0; cubeY <= (length >> 4) + 1; cubeY++) { - for (int cubeZ = 0; cubeZ <= (height >> 4) + 1; cubeZ++) { + for (int cubeY = 0; cubeY <= (height >> 4) + 1; cubeY++) { + for (int cubeZ = 0; cubeZ <= (length >> 4) + 1; cubeZ++) { long setStart = System.nanoTime(); // Get the cube only once for efficiency Cube cube = cubicWorld.getCubeFromCubeCoords((xBase << 4) + cubeX, (yBase << 4) + cubeY, (zBase << 4) + cubeZ); @@ -456,7 +456,8 @@ public class Schematic { IBlockState state = palette.get(blockData[sx][sy][sz]); if (!state.getBlock().equals(Blocks.AIR)) { if (storage == null) { - storageArray[storageY] = storage = new ExtendedBlockStorage(storageY << 4, world.provider.hasSkyLight()); + storage = new ExtendedBlockStorage(((yBase >> 4) + storageY) << 4, world.provider.hasSkyLight()); + storageArray[(yBase >> 4) + storageY] = storage; } storage.set(x, y, z, state); } else if (setAir) {