Merge pull request #681 from mikeprimm/fix_addblockschematicsave
Fix AddBlock stream to write bytes on odd vs even offsets (off-by-one)
This commit is contained in:
commit
515a8ebdf4
@ -222,7 +222,7 @@ public class SchematicWriter implements ClipboardWriter {
|
|||||||
clipboard.IMP.streamIds(new NBTStreamer.ByteReader() {
|
clipboard.IMP.streamIds(new NBTStreamer.ByteReader() {
|
||||||
@Override
|
@Override
|
||||||
public void run(int index, int byteValue) {
|
public void run(int index, int byteValue) {
|
||||||
if (write[0] ^= true) {
|
if (write[0]) {
|
||||||
try {
|
try {
|
||||||
rawStream.write(((byteValue >> 8) << 4) + (lastAdd[0]));
|
rawStream.write(((byteValue >> 8) << 4) + (lastAdd[0]));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -231,6 +231,7 @@ public class SchematicWriter implements ClipboardWriter {
|
|||||||
} else {
|
} else {
|
||||||
lastAdd[0] = byteValue >> 8;
|
lastAdd[0] = byteValue >> 8;
|
||||||
}
|
}
|
||||||
|
write[0] ^= true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (write[0]) {
|
if (write[0]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user