Skip to content

Commit bb1907c

Browse files
committed
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.
1 parent e080dda commit bb1907c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/org/dimdev/ddutils/schem/Schematic.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ private void setBlocks(World world, int xBase, int yBase, int zBase) {
399399
DimDoors.log.info("Setting cube blockstates");
400400
ICubicWorld cubicWorld = (ICubicWorld) world;
401401
for (int cubeX = 0; cubeX <= (width >> 4) + 1; cubeX++) {
402-
for (int cubeY = 0; cubeY <= (length >> 4) + 1; cubeY++) {
403-
for (int cubeZ = 0; cubeZ <= (height >> 4) + 1; cubeZ++) {
402+
for (int cubeY = 0; cubeY <= (height >> 4) + 1; cubeY++) {
403+
for (int cubeZ = 0; cubeZ <= (length >> 4) + 1; cubeZ++) {
404404
long setStart = System.nanoTime();
405405
// Get the cube only once for efficiency
406406
Cube cube = cubicWorld.getCubeFromCubeCoords((xBase << 4) + cubeX, (yBase << 4) + cubeY, (zBase << 4) + cubeZ);
@@ -456,7 +456,8 @@ private void setBlocks(World world, int xBase, int yBase, int zBase) {
456456
IBlockState state = palette.get(blockData[sx][sy][sz]);
457457
if (!state.getBlock().equals(Blocks.AIR)) {
458458
if (storage == null) {
459-
storageArray[storageY] = storage = new ExtendedBlockStorage(storageY << 4, world.provider.hasSkyLight());
459+
storage = new ExtendedBlockStorage(((yBase >> 4) + storageY) << 4, world.provider.hasSkyLight());
460+
storageArray[(yBase >> 4) + storageY] = storage;
460461
}
461462
storage.set(x, y, z, state);
462463
} else if (setAir) {

0 commit comments

Comments
 (0)