mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Don't save corrupt schematics so that when they load, they work.
This commit is contained in:
parent
c85ff7ddda
commit
6d71177394
@ -537,7 +537,7 @@ public abstract class SchematicHandler {
|
|||||||
schematic.put("Palette", new CompoundTag(paletteTag));
|
schematic.put("Palette", new CompoundTag(paletteTag));
|
||||||
schematic.put("BlockData", new ByteArrayTag(buffer.toByteArray()));
|
schematic.put("BlockData", new ByteArrayTag(buffer.toByteArray()));
|
||||||
schematic
|
schematic
|
||||||
.put("TileEntities", new ListTag(CompoundTag.class, tileEntities));
|
.put("BlockEntities", new ListTag(CompoundTag.class, tileEntities));
|
||||||
|
|
||||||
schematic.put("BiomePaletteMax", new IntTag(biomePalette.size()));
|
schematic.put("BiomePaletteMax", new IntTag(biomePalette.size()));
|
||||||
|
|
||||||
@ -602,8 +602,6 @@ public abstract class SchematicHandler {
|
|||||||
values.put(entry.getKey(),
|
values.put(entry.getKey(),
|
||||||
entry.getValue());
|
entry.getValue());
|
||||||
}
|
}
|
||||||
// Remove 'id' if it exists. We want 'Id'
|
|
||||||
values.remove("id");
|
|
||||||
|
|
||||||
// Positions are kept in NBT, we don't want that.
|
// Positions are kept in NBT, we don't want that.
|
||||||
values.remove("x");
|
values.remove("x");
|
||||||
@ -612,6 +610,11 @@ public abstract class SchematicHandler {
|
|||||||
|
|
||||||
values.put("Id",
|
values.put("Id",
|
||||||
new StringTag(block.getNbtId()));
|
new StringTag(block.getNbtId()));
|
||||||
|
|
||||||
|
// Remove 'id' if it exists. We want 'Id'.
|
||||||
|
// Do this after we get "getNbtId" cos otherwise "getNbtId" doesn't work.
|
||||||
|
// Dum.
|
||||||
|
values.remove("id");
|
||||||
values.put("Pos", new IntArrayTag(
|
values.put("Pos", new IntArrayTag(
|
||||||
new int[] {rx, ry, rz}));
|
new int[] {rx, ry, rz}));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user