Throw NoClipboardExceptions again! #82
@ -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();
|
||||
|
@ -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 {
|
||||
|
@ -19,5 +19,5 @@
|
||||
|
||||
package de.steamwar.sql;
|
||||
|
||||
public class NoClipboardException extends Exception {
|
||||
public class NoClipboardException extends RuntimeException {
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren