SteamWar/SpigotCore
Archiviert
13
0

Throw NoClipboardExceptions again! #82

Manuell gemergt
Lixfel hat 1 Commits von throwNoClipboardExceptionsAgain nach master 2020-12-25 23:32:32 +01:00 zusammengeführt
3 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -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();

Datei anzeigen

@ -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 {

Datei anzeigen

@ -19,5 +19,5 @@
package de.steamwar.sql;
public class NoClipboardException extends Exception {
public class NoClipboardException extends RuntimeException {
}