diff --git a/SpigotCore_14/src/de/steamwar/sql/Schematic_14.java b/SpigotCore_14/src/de/steamwar/sql/Schematic_14.java index 675da6e..3e3164f 100644 --- a/SpigotCore_14/src/de/steamwar/sql/Schematic_14.java +++ b/SpigotCore_14/src/de/steamwar/sql/Schematic_14.java @@ -69,12 +69,12 @@ class Schematic_14 { try { clipboardHolder = getWorldEditPlugin().getSession(player).getClipboard(); } catch (EmptyClipboardException e) { - throw new RuntimeException(e.getMessage(), new NoClipboardException()); + throw new NoClipboardException(); } Clipboard clipboard = clipboardHolder.getClipboard(); if(clipboard == null) - throw new RuntimeException("Clipboard was null", new NoClipboardException()); + throw new NoClipboardException(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try{ @@ -97,18 +97,18 @@ class Schematic_14 { Clipboard clipboard = null; try { clipboard = getClipboard(is, schemFormat); - } catch (IOException | NoClipboardException e) { + } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } if (clipboard == null) - throw new RuntimeException("clipboard was null", new NoClipboardException()); + throw new NoClipboardException(); Actor actor = getWorldEditPlugin().wrapCommandSender(player); getWorldEditPlugin().getWorldEdit().getSessionManager().get(actor).setClipboard(new ClipboardHolder(clipboard)); } - static Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException, NoClipboardException { + static Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException { try { if(schemFormat){ return new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is))).read(); diff --git a/SpigotCore_8/src/de/steamwar/sql/Schematic_8.java b/SpigotCore_8/src/de/steamwar/sql/Schematic_8.java index 8578007..7461ec1 100644 --- a/SpigotCore_8/src/de/steamwar/sql/Schematic_8.java +++ b/SpigotCore_8/src/de/steamwar/sql/Schematic_8.java @@ -57,12 +57,12 @@ class Schematic_8 { try { clipboardHolder = getWorldEditPlugin().getSession(player).getClipboard(); } catch (EmptyClipboardException e) { - throw new RuntimeException(e.getMessage(), e); + throw new NoClipboardException(); } Clipboard clipboard = clipboardHolder.getClipboard(); if(clipboard == null) - throw new RuntimeException("clipboard was null", new NoClipboardException()); + throw new NoClipboardException(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { diff --git a/SpigotCore_API/src/de/steamwar/sql/NoClipboardException.java b/SpigotCore_API/src/de/steamwar/sql/NoClipboardException.java index f7b6bc2..9743348 100644 --- a/SpigotCore_API/src/de/steamwar/sql/NoClipboardException.java +++ b/SpigotCore_API/src/de/steamwar/sql/NoClipboardException.java @@ -19,5 +19,5 @@ package de.steamwar.sql; -public class NoClipboardException extends Exception { +public class NoClipboardException extends RuntimeException { }