Stop writing corrupt tile entities to schematics

also make some stuff definitely immutable.
This commit is contained in:
dordsor21
2020-12-13 21:06:36 +00:00
parent 04ba545aa2
commit 6676d77aaa
3 changed files with 16 additions and 12 deletions

View File

@ -159,15 +159,16 @@ public class FastSchematicWriter implements ClipboardWriter {
if (nbt != null) {
Map<String, Tag> values = nbt.getValue();
values.remove("id"); // Remove 'id' if it exists. We want 'Id'
// Positions are kept in NBT, we don't want that.
values.remove("x");
values.remove("y");
values.remove("z");
if (!values.containsKey("Id")) {
values.put("Id", new StringTag(block.getNbtId()));
}
values.put("Id", 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(new int[]{
pos.getX(),
pos.getY(),