From 61ff3fb24d642909c208bc35f02423d70fc76f18 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 9 Dec 2019 11:15:27 +0100 Subject: [PATCH] Fix CuboidClipboard-Chaos --- SpigotCore_12/pom.xml | 1 - SpigotCore_8/pom.xml | 1 - SpigotCore_8/src/de/steamwar/sql/Schematic_8.java | 12 +++--------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/SpigotCore_12/pom.xml b/SpigotCore_12/pom.xml index 29e7adb..0959553 100644 --- a/SpigotCore_12/pom.xml +++ b/SpigotCore_12/pom.xml @@ -49,7 +49,6 @@ steamwar SpigotCore_API 2.0 - compile steamwar diff --git a/SpigotCore_8/pom.xml b/SpigotCore_8/pom.xml index 482fe5b..80681bb 100644 --- a/SpigotCore_8/pom.xml +++ b/SpigotCore_8/pom.xml @@ -43,7 +43,6 @@ steamwar SpigotCore_API 2.0 - compile \ No newline at end of file diff --git a/SpigotCore_8/src/de/steamwar/sql/Schematic_8.java b/SpigotCore_8/src/de/steamwar/sql/Schematic_8.java index e6ef7f9..edc28c2 100644 --- a/SpigotCore_8/src/de/steamwar/sql/Schematic_8.java +++ b/SpigotCore_8/src/de/steamwar/sql/Schematic_8.java @@ -1,14 +1,12 @@ package de.steamwar.sql; import com.sk89q.worldedit.EmptyClipboardException; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.bukkit.BukkitWorld; import com.sk89q.worldedit.bukkit.WorldEditPlugin; -import com.sk89q.worldedit.data.DataException; 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.schematic.MCEditSchematicFormat; -import com.sk89q.worldedit.schematic.SchematicFormat; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.world.registry.WorldData; import org.bukkit.Bukkit; @@ -46,12 +44,8 @@ class Schematic_8 { getWorldEditPlugin().getWorldEdit().getSessionManager().get(actor).setClipboard(new ClipboardHolder(clipboard, world)); } - static Clipboard getClipboard(InputStream is) throws IOException, NoClipboardException { - try { - return (Clipboard) ((MCEditSchematicFormat)SchematicFormat.getFormat("mcedit")).load(is); - } catch (DataException e) { - throw new NoClipboardException(); - } + static Clipboard getClipboard(InputStream is) throws IOException { + return ClipboardFormat.findByAlias("mcedit").getReader(is).read(WorldEdit.getInstance().getServer().getWorlds().get(0).getWorldData()); } private static WorldEditPlugin getWorldEditPlugin() {