diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java index 39b9bc107..634603277 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReaderV3.java @@ -58,10 +58,6 @@ import java.util.function.BooleanSupplier; import java.util.function.Function; import java.util.zip.GZIPInputStream; -/** - * TODO: fix tile entity locations (+ validate entity location) - */ - /** * ClipboardReader for the Sponge Schematic Format v3. * Not necessarily much faster than {@link com.sk89q.worldedit.extent.clipboard.io.sponge.SpongeSchematicV3Reader}, but uses a @@ -350,7 +346,6 @@ public class FastSchematicReaderV3 implements ClipboardReader { final NBTOutputStream cacheStream = new NBTOutputStream(this.getDataCacheWriter()); cacheStream.writeByte(CACHE_IDENTIFIER_ENTITIES); cacheStream.writeTagPayload(this.nbtInputStream.readTagPayload(NBTConstants.TYPE_LIST, 0)); - System.out.println("Wrote entities to cache"); return; } if (this.dataInputStream.read() != NBTConstants.TYPE_COMPOUND) { @@ -437,6 +432,7 @@ public class FastSchematicReaderV3 implements ClipboardReader { if (!stream.readUTF().equals("Data")) { throw new IOException("Expected COMPOUND tag to be Data"); } + //noinspection deprecation tag = ((CompoundTag) nbtStream.readTagPayload(NBTConstants.TYPE_COMPOUND, 0)).asBinaryTag(); } default -> throw new IOException("Unexpected tag in compound: " + type); @@ -631,6 +627,7 @@ public class FastSchematicReaderV3 implements ClipboardReader { } private EntityTransformer provideTileEntityTransformer(Clipboard clipboard) { + //noinspection deprecation return (x, y, z, id, tag) -> clipboard.setTile( MathMan.roundInt(x + clipboard.getMinimumPoint().x()), MathMan.roundInt(y + clipboard.getMinimumPoint().y()), diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicWriterV3.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicWriterV3.java index 0050b4dd6..ad2a020fc 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicWriterV3.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicWriterV3.java @@ -125,12 +125,14 @@ public class FastSchematicWriterV3 implements ClipboardWriter { CompoundBinaryTag tag; if ((tag = block.getNbt()) != null) { tiles[0]++; - BlockVector3 posNormalized = pos.subtract(clipboard.getMinimumPoint()); try { tileOut.writeNamedTag("Id", block.getNbtId()); tileOut.writeNamedTag("Pos", new int[]{ - posNormalized.x(), posNormalized.y(), posNormalized.z() + pos.x() - clipboard.getMinimumPoint().x(), + pos.y() - clipboard.getMinimumPoint().y(), + pos.z() - clipboard.getMinimumPoint().z() }); + //noinspection deprecation tileOut.writeNamedTag("Data", new CompoundTag(tag)); tileOut.write(NBTConstants.TYPE_END); } catch (IOException e) { @@ -189,6 +191,7 @@ public class FastSchematicWriterV3 implements ClipboardWriter { out.writeDouble(entity.getLocation().z() - clipboard.getMinimumPoint().z()); out.writeLazyCompoundTag("Data", data -> { + //noinspection deprecation CompoundTag nbt = state.getNbtData(); if (nbt != null) { nbt.getValue().forEach((s, tag) -> { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java index b89509877..951fd0b77 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java @@ -296,7 +296,7 @@ public enum BuiltInClipboardFormat implements ClipboardFormat { return true; } }, - SPONGE_V3_SCHEMATIC("sponge.3", "slow", "safe") { + SPONGE_V3_SCHEMATIC("sponge.3", "slow", "safe") { // FAWE edit aliases for fast @Override public String getPrimaryFileExtension() { return "schem";