Throw NoClipboardExceptions again!
Dieser Commit ist enthalten in:
Ursprung
1b4507c7e2
Commit
af7a53e005
@ -69,12 +69,12 @@ class Schematic_14 {
|
|||||||
try {
|
try {
|
||||||
clipboardHolder = getWorldEditPlugin().getSession(player).getClipboard();
|
clipboardHolder = getWorldEditPlugin().getSession(player).getClipboard();
|
||||||
} catch (EmptyClipboardException e) {
|
} catch (EmptyClipboardException e) {
|
||||||
throw new RuntimeException(e.getMessage(), new NoClipboardException());
|
throw new NoClipboardException();
|
||||||
}
|
}
|
||||||
|
|
||||||
Clipboard clipboard = clipboardHolder.getClipboard();
|
Clipboard clipboard = clipboardHolder.getClipboard();
|
||||||
if(clipboard == null)
|
if(clipboard == null)
|
||||||
throw new RuntimeException("Clipboard was null", new NoClipboardException());
|
throw new NoClipboardException();
|
||||||
|
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||||
try{
|
try{
|
||||||
@ -97,18 +97,18 @@ class Schematic_14 {
|
|||||||
Clipboard clipboard = null;
|
Clipboard clipboard = null;
|
||||||
try {
|
try {
|
||||||
clipboard = getClipboard(is, schemFormat);
|
clipboard = getClipboard(is, schemFormat);
|
||||||
} catch (IOException | NoClipboardException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e.getMessage(), e);
|
throw new RuntimeException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clipboard == null)
|
if (clipboard == null)
|
||||||
throw new RuntimeException("clipboard was null", new NoClipboardException());
|
throw new NoClipboardException();
|
||||||
|
|
||||||
Actor actor = getWorldEditPlugin().wrapCommandSender(player);
|
Actor actor = getWorldEditPlugin().wrapCommandSender(player);
|
||||||
getWorldEditPlugin().getWorldEdit().getSessionManager().get(actor).setClipboard(new ClipboardHolder(clipboard));
|
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 {
|
try {
|
||||||
if(schemFormat){
|
if(schemFormat){
|
||||||
return new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is))).read();
|
return new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is))).read();
|
||||||
|
@ -57,12 +57,12 @@ class Schematic_8 {
|
|||||||
try {
|
try {
|
||||||
clipboardHolder = getWorldEditPlugin().getSession(player).getClipboard();
|
clipboardHolder = getWorldEditPlugin().getSession(player).getClipboard();
|
||||||
} catch (EmptyClipboardException e) {
|
} catch (EmptyClipboardException e) {
|
||||||
throw new RuntimeException(e.getMessage(), e);
|
throw new NoClipboardException();
|
||||||
}
|
}
|
||||||
|
|
||||||
Clipboard clipboard = clipboardHolder.getClipboard();
|
Clipboard clipboard = clipboardHolder.getClipboard();
|
||||||
if(clipboard == null)
|
if(clipboard == null)
|
||||||
throw new RuntimeException("clipboard was null", new NoClipboardException());
|
throw new NoClipboardException();
|
||||||
|
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||||
try {
|
try {
|
||||||
|
@ -19,5 +19,5 @@
|
|||||||
|
|
||||||
package de.steamwar.sql;
|
package de.steamwar.sql;
|
||||||
|
|
||||||
public class NoClipboardException extends Exception {
|
public class NoClipboardException extends RuntimeException {
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren