From 602ea38b24cff80c39a34c824ee8eeacadc6e692 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 10 Nov 2019 20:48:13 +0100 Subject: [PATCH] Fixing save 1.12 positioning bug --- .../src/de/steamwar/schematicsystem/WorldEdit_v12.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SchematicSystem_12/src/de/steamwar/schematicsystem/WorldEdit_v12.java b/SchematicSystem_12/src/de/steamwar/schematicsystem/WorldEdit_v12.java index 9031000..3bc53b8 100644 --- a/SchematicSystem_12/src/de/steamwar/schematicsystem/WorldEdit_v12.java +++ b/SchematicSystem_12/src/de/steamwar/schematicsystem/WorldEdit_v12.java @@ -10,7 +10,6 @@ import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; -import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.world.World; import org.bukkit.Bukkit; @@ -18,6 +17,7 @@ import org.bukkit.Location; import org.bukkit.entity.Player; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.Files; @@ -38,9 +38,9 @@ class WorldEdit_v12 { File file = new File(folder, name + ".schematic"); file.createNewFile(); Files.setPosixFilePermissions(file.toPath(), Constants.FILE_PERMS); - Region region = clipboard.getRegion(); - Schematic schem = new Schematic(region); - schem.save(file, ClipboardFormat.SCHEMATIC); + + ClipboardFormat.SCHEMATIC.getWriter(new FileOutputStream(file)).write(clipboard, clipboardHolder.getWorldData()); + } static void loadClipboardToPlayer(Player player, Clipboard clipboard){