- Similar to previous commit. If the chunksection was empty, then __reserved__ was parsed to the clipboard, and then not correctly identified as air
- Now assume all __reserved__ is air when writing to clipboards
This commit is contained in:
dordsor21 2020-05-09 13:56:41 +01:00
parent ffa25b1d9a
commit 42d7419b4b
3 changed files with 11 additions and 1 deletions

View File

@ -184,7 +184,11 @@ public class CPUOptimizedClipboard extends LinearClipboard {
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(int index, B block) {
states[index] = block.getOrdinalChar();
char ordinal = block.getOrdinalChar();
if (ordinal == 0) {
ordinal = 1;
}
states[index] = ordinal;
boolean hasNbt = block instanceof BaseBlock && block.hasNbtData();
if (hasNbt) {
setTile(index, block.getNbtData());

View File

@ -388,6 +388,9 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
try {
int index = HEADER_SIZE + (getIndex(x, y, z) << 1);
char ordinal = block.getOrdinalChar();
if (ordinal == 0) {
ordinal = 1;
}
byteBuffer.putChar(index, ordinal);
boolean hasNbt = block instanceof BaseBlock && block.hasNbtData();
if (hasNbt) {

View File

@ -263,6 +263,9 @@ public class MemoryOptimizedClipboard extends LinearClipboard {
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(int index, B block) {
int ordinal = block.getOrdinal();
if (ordinal == 0) {
ordinal = 1;
}
setOrdinal(index, ordinal);
boolean hasNbt = block instanceof BaseBlock && block.hasNbtData();
if (hasNbt) {