Skip to content

Commit

Permalink
Fixed gateways generating half of themselves 48 blocks lower
Browse files Browse the repository at this point in the history
-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.
  • Loading branch information
Robijnvogel committed Apr 7, 2018
1 parent e080dda commit bb1907c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/dimdev/ddutils/schem/Schematic.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ private void setBlocks(World world, int xBase, int yBase, int zBase) {
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);
Expand Down Expand Up @@ -456,7 +456,8 @@ private void setBlocks(World world, int xBase, int yBase, int zBase) {
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) {
Expand Down

0 comments on commit bb1907c

Please sign in to comment.