mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-15 23:26:33 +01:00
Fixes #726
This commit is contained in:
parent
398943b9b0
commit
477ae2a76d
@ -72,6 +72,14 @@ public class SchematicStreamer extends NBTStreamer {
|
|||||||
fc.setBiome(index, value);
|
fc.setBiome(index, value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
NBTStreamReader<Integer, Integer> initializer23 = new NBTStreamReader<Integer, Integer>() {
|
||||||
|
@Override
|
||||||
|
public void run(Integer value1, Integer value2) {
|
||||||
|
if (fc == null) setupClipboard(length * width * height);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
addReader("Schematic.AWEBiomes.?", initializer23);
|
||||||
|
addReader("Schematic.Biomes.?", initializer23);
|
||||||
addReader("Schematic.AWEBiomes.#", biomeReader); // AWE stores as an int[]
|
addReader("Schematic.AWEBiomes.#", biomeReader); // AWE stores as an int[]
|
||||||
addReader("Schematic.Biomes.#", biomeReader); // FAWE stores as a byte[] (4x smaller)
|
addReader("Schematic.Biomes.#", biomeReader); // FAWE stores as a byte[] (4x smaller)
|
||||||
|
|
||||||
|
@ -155,21 +155,6 @@ public class SchematicWriter implements ClipboardWriter {
|
|||||||
out.writeNamedTag("WEOffsetZ", (offset.getBlockZ()));
|
out.writeNamedTag("WEOffsetZ", (offset.getBlockZ()));
|
||||||
out.writeNamedTag("Platform", Fawe.imp().getPlatform());
|
out.writeNamedTag("Platform", Fawe.imp().getPlatform());
|
||||||
|
|
||||||
if (clipboard.IMP.hasBiomes()) {
|
|
||||||
out.writeNamedTagName("Biomes", NBTConstants.TYPE_BYTE_ARRAY);
|
|
||||||
out.getOutputStream().writeInt(width * length); // area
|
|
||||||
clipboard.IMP.streamBiomes(new NBTStreamer.ByteReader() {
|
|
||||||
@Override
|
|
||||||
public void run(int index, int byteValue) {
|
|
||||||
try {
|
|
||||||
rawStream.writeByte(byteValue);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
out.writeNamedTagName("Blocks", NBTConstants.TYPE_BYTE_ARRAY);
|
out.writeNamedTagName("Blocks", NBTConstants.TYPE_BYTE_ARRAY);
|
||||||
out.getOutputStream().writeInt(volume);
|
out.getOutputStream().writeInt(volume);
|
||||||
clipboard.IMP.streamIds(new NBTStreamer.ByteReader() {
|
clipboard.IMP.streamIds(new NBTStreamer.ByteReader() {
|
||||||
@ -239,6 +224,21 @@ public class SchematicWriter implements ClipboardWriter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clipboard.IMP.hasBiomes()) {
|
||||||
|
out.writeNamedTagName("Biomes", NBTConstants.TYPE_BYTE_ARRAY);
|
||||||
|
out.getOutputStream().writeInt(width * length); // area
|
||||||
|
clipboard.IMP.streamBiomes(new NBTStreamer.ByteReader() {
|
||||||
|
@Override
|
||||||
|
public void run(int index, int byteValue) {
|
||||||
|
try {
|
||||||
|
rawStream.writeByte(byteValue);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (hasTile) {
|
if (hasTile) {
|
||||||
final List<CompoundTag> tileEntities = clipboard.IMP.getTileEntities();
|
final List<CompoundTag> tileEntities = clipboard.IMP.getTileEntities();
|
||||||
out.writeNamedTag("TileEntities", new ListTag(CompoundTag.class, tileEntities));
|
out.writeNamedTag("TileEntities", new ListTag(CompoundTag.class, tileEntities));
|
||||||
|
Loading…
Reference in New Issue
Block a user