mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
fix cfi issues
This commit is contained in:
parent
b9cefc1936
commit
0ef97ccf28
@ -84,7 +84,7 @@ public abstract class MCAWriter {
|
|||||||
protected WritableMCAChunk initialValue() {
|
protected WritableMCAChunk initialValue() {
|
||||||
WritableMCAChunk chunk = new WritableMCAChunk();
|
WritableMCAChunk chunk = new WritableMCAChunk();
|
||||||
Arrays.fill(chunk.blocks, BlockID.AIR);
|
Arrays.fill(chunk.blocks, BlockID.AIR);
|
||||||
Arrays.fill(chunk.skyLight, (byte) 255);
|
// Arrays.fill(chunk.skyLight, (byte) 255);
|
||||||
return chunk;
|
return chunk;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -91,12 +91,12 @@ public class WritableMCAChunk extends FaweChunk<Void> {
|
|||||||
|
|
||||||
public void write(NBTOutputStream nbtOut) throws IOException {
|
public void write(NBTOutputStream nbtOut) throws IOException {
|
||||||
nbtOut.writeNamedTagName("", NBTConstants.TYPE_COMPOUND);
|
nbtOut.writeNamedTagName("", NBTConstants.TYPE_COMPOUND);
|
||||||
|
nbtOut.writeNamedTag("DataVersion", 1631);
|
||||||
nbtOut.writeLazyCompoundTag("Level", out -> {
|
nbtOut.writeLazyCompoundTag("Level", out -> {
|
||||||
out.writeNamedTag("V", (byte) 1);
|
// out.writeNamedTag("V", (byte) 1);
|
||||||
|
out.writeNamedTag("Status", "decorated");
|
||||||
out.writeNamedTag("xPos", getX());
|
out.writeNamedTag("xPos", getX());
|
||||||
out.writeNamedTag("zPos", getZ());
|
out.writeNamedTag("zPos", getZ());
|
||||||
out.writeNamedTag("LightPopulated", (byte) 0);
|
|
||||||
out.writeNamedTag("TerrainPopulated", (byte) 1);
|
|
||||||
if (entities.isEmpty()) {
|
if (entities.isEmpty()) {
|
||||||
out.writeNamedEmptyList("Entities");
|
out.writeNamedEmptyList("Entities");
|
||||||
} else {
|
} else {
|
||||||
@ -180,7 +180,9 @@ public class WritableMCAChunk extends FaweChunk<Void> {
|
|||||||
int bitsPerEntry = MathMan.log2nlz(num_palette - 1);
|
int bitsPerEntry = MathMan.log2nlz(num_palette - 1);
|
||||||
int blockBitArrayEnd = (bitsPerEntry * 4096) >> 6;
|
int blockBitArrayEnd = (bitsPerEntry * 4096) >> 6;
|
||||||
if (num_palette == 1) {
|
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 {
|
} else {
|
||||||
BitArray4096 bitArray = new BitArray4096(blockstates, bitsPerEntry);
|
BitArray4096 bitArray = new BitArray4096(blockstates, bitsPerEntry);
|
||||||
bitArray.fromRaw(blocks, blockIndexStart);
|
bitArray.fromRaw(blocks, blockIndexStart);
|
||||||
@ -357,7 +359,7 @@ public class WritableMCAChunk extends FaweChunk<Void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void removeLight() {
|
public void removeLight() {
|
||||||
for (int i = 0; i < skyLight.length; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
removeLight(i);
|
removeLight(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user