mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2025-01-31 20:52:08 +01:00
Merge pull request #673 from mikeprimm/addblock_bugfix
Fix problems with handling of schematic loads with extended block IDs
This commit is contained in:
commit
371f61c36b
@ -33,9 +33,15 @@ public class SchematicStreamer extends NBTStreamer {
|
|||||||
setupClipboard(length);
|
setupClipboard(length);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
NBTStreamReader initializer2 = new NBTStreamReader<Integer, Integer>() {
|
||||||
|
@Override
|
||||||
|
public void run(Integer length, Integer type) {
|
||||||
|
setupClipboard(length*2);
|
||||||
|
}
|
||||||
|
};
|
||||||
addReader("Schematic.Blocks.?", initializer);
|
addReader("Schematic.Blocks.?", initializer);
|
||||||
addReader("Schematic.Data.?", initializer);
|
addReader("Schematic.Data.?", initializer);
|
||||||
addReader("Schematic.AddBlocks.?", initializer);
|
addReader("Schematic.AddBlocks.?", initializer2);
|
||||||
addReader("Schematic.Blocks.#", new ByteReader() {
|
addReader("Schematic.Blocks.#", new ByteReader() {
|
||||||
@Override
|
@Override
|
||||||
public void run(int index, int value) {
|
public void run(int index, int value) {
|
||||||
|
@ -238,6 +238,8 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
area = width * length;
|
area = width * length;
|
||||||
volume = width * length * height;
|
volume = width * length * height;
|
||||||
long size = width * height * length * 2l + HEADER_SIZE + (hasBiomes() ? area : 0);
|
long size = width * height * length * 2l + HEADER_SIZE + (hasBiomes() ? area : 0);
|
||||||
|
close();
|
||||||
|
this.braf = new RandomAccessFile(file, "rw");
|
||||||
braf.setLength(size);
|
braf.setLength(size);
|
||||||
init();
|
init();
|
||||||
mbb.putChar(2, (char) width);
|
mbb.putChar(2, (char) width);
|
||||||
@ -519,9 +521,8 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
int index = (HEADER_SIZE) + (i << 1);
|
int index = (HEADER_SIZE) + (i << 1);
|
||||||
// 00000000 00000000
|
// 00000000 00000000
|
||||||
// [ id ]data
|
// [ id ]data
|
||||||
byte id2 = mbb.get(index + 1);
|
char combined = mbb.getChar(index);
|
||||||
mbb.put(index, (byte) (id >> 4));
|
mbb.putChar(index, (char) ((combined & 0xF00F) + (id << 4)));
|
||||||
mbb.put(index + 1, (byte) (((id & 0xFF) << 4) + (id2 & 0xFF)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCombined(int i, int combined) {
|
public void setCombined(int i, int combined) {
|
||||||
@ -534,7 +535,7 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
// 00000000 00000000
|
// 00000000 00000000
|
||||||
// [ id ]data
|
// [ id ]data
|
||||||
char combined = mbb.getChar(index);
|
char combined = mbb.getChar(index);
|
||||||
mbb.putChar(index, (char) ((combined & 0xFFFF) + (add << 12)));
|
mbb.putChar(index, (char) ((combined & 0x0FFF) + (add << 12)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user