From 0ef97ccf284298bbadb1d3350ca010baf3af2822 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 11 Apr 2019 00:49:16 +1000 Subject: [PATCH] fix cfi issues --- .../java/com/boydti/fawe/jnbt/anvil/MCAWriter.java | 2 +- .../com/boydti/fawe/jnbt/anvil/WritableMCAChunk.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAWriter.java b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAWriter.java index 51f523a53..b300649c3 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAWriter.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/MCAWriter.java @@ -84,7 +84,7 @@ public abstract class MCAWriter { protected WritableMCAChunk initialValue() { WritableMCAChunk chunk = new WritableMCAChunk(); Arrays.fill(chunk.blocks, BlockID.AIR); - Arrays.fill(chunk.skyLight, (byte) 255); +// Arrays.fill(chunk.skyLight, (byte) 255); return chunk; } }; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/WritableMCAChunk.java b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/WritableMCAChunk.java index 76359d3a8..a8d10d059 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/WritableMCAChunk.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/anvil/WritableMCAChunk.java @@ -91,12 +91,12 @@ public class WritableMCAChunk extends FaweChunk { public void write(NBTOutputStream nbtOut) throws IOException { nbtOut.writeNamedTagName("", NBTConstants.TYPE_COMPOUND); + nbtOut.writeNamedTag("DataVersion", 1631); nbtOut.writeLazyCompoundTag("Level", out -> { - out.writeNamedTag("V", (byte) 1); +// out.writeNamedTag("V", (byte) 1); + out.writeNamedTag("Status", "decorated"); out.writeNamedTag("xPos", getX()); out.writeNamedTag("zPos", getZ()); - out.writeNamedTag("LightPopulated", (byte) 0); - out.writeNamedTag("TerrainPopulated", (byte) 1); if (entities.isEmpty()) { out.writeNamedEmptyList("Entities"); } else { @@ -180,7 +180,9 @@ public class WritableMCAChunk extends FaweChunk { int bitsPerEntry = MathMan.log2nlz(num_palette - 1); int blockBitArrayEnd = (bitsPerEntry * 4096) >> 6; if (num_palette == 1) { - Arrays.fill(blockstates, 0, blockBitArrayEnd, 0); + // Set a value, because minecraft needs it for some reason + blockstates[0] = 0; + blockBitArrayEnd = 1; } else { BitArray4096 bitArray = new BitArray4096(blockstates, bitsPerEntry); bitArray.fromRaw(blocks, blockIndexStart); @@ -357,7 +359,7 @@ public class WritableMCAChunk extends FaweChunk { } public void removeLight() { - for (int i = 0; i < skyLight.length; i++) { + for (int i = 0; i < 16; i++) { removeLight(i); } }