mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 20:36:42 +00:00
Added LongArrayTag support to NBT
This commit is contained in:
@ -76,7 +76,7 @@ public enum BuiltInClipboardFormat implements ClipboardFormat {
|
||||
if (!schematic.containsKey("Materials")) {
|
||||
return false;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -115,7 +115,7 @@ public enum BuiltInClipboardFormat implements ClipboardFormat {
|
||||
if (!schematic.containsKey("Version")) {
|
||||
return false;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -202,6 +202,12 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
handler.updateNBT(state, values);
|
||||
}
|
||||
}
|
||||
values.put("x", new IntTag(pt.getBlockX()));
|
||||
values.put("y", new IntTag(pt.getBlockY()));
|
||||
values.put("z", new IntTag(pt.getBlockZ()));
|
||||
values.put("id", values.get("Id"));
|
||||
values.remove("Id");
|
||||
values.remove("Pos");
|
||||
clipboard.setBlock(pt, new BaseBlock(state, new CompoundTag(values)));
|
||||
} else {
|
||||
clipboard.setBlock(pt, state);
|
||||
|
@ -117,7 +117,7 @@ public class SpongeSchematicWriter implements ClipboardWriter {
|
||||
int paletteMax = 0;
|
||||
Map<String, Integer> palette = new HashMap<>();
|
||||
|
||||
List<Tag> tileEntities = new ArrayList<>();
|
||||
List<CompoundTag> tileEntities = new ArrayList<>();
|
||||
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream(width * height * length);
|
||||
|
||||
@ -135,6 +135,13 @@ public class SpongeSchematicWriter implements ClipboardWriter {
|
||||
values.put(entry.getKey(), entry.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");
|
||||
|
||||
values.put("Id", new StringTag(block.getNbtId()));
|
||||
values.put("Pos", new IntArrayTag(new int[]{
|
||||
x,
|
||||
@ -142,8 +149,7 @@ public class SpongeSchematicWriter implements ClipboardWriter {
|
||||
z
|
||||
}));
|
||||
|
||||
CompoundTag tileEntityTag = new CompoundTag(values);
|
||||
tileEntities.add(tileEntityTag);
|
||||
tileEntities.add(new CompoundTag(values));
|
||||
}
|
||||
|
||||
String blockKey = block.toImmutableState().getAsString();
|
||||
|
Reference in New Issue
Block a user