From 152d870cdbb5ad7e3ad019e301083c298cee1aaf Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Thu, 8 Jun 2023 10:24:44 +0200 Subject: [PATCH] Improve exception handling on adapter loading (#2277) --- .../impl/fawe/v1_19_R3/PaperweightPlatformAdapter.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/worldedit-bukkit/adapters/adapter-1_19_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_19_R3/PaperweightPlatformAdapter.java b/worldedit-bukkit/adapters/adapter-1_19_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_19_R3/PaperweightPlatformAdapter.java index 9f8938cec..cb4ab2f2a 100644 --- a/worldedit-bukkit/adapters/adapter-1_19_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_19_R3/PaperweightPlatformAdapter.java +++ b/worldedit-bukkit/adapters/adapter-1_19_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_19_R3/PaperweightPlatformAdapter.java @@ -215,14 +215,13 @@ public final class PaperweightPlatformAdapter extends NMSAdapter { } catch (NoSuchFieldException ignored) { } POST_CHUNK_REWRITE = chunkRewrite; - } catch (RuntimeException e) { + } catch (RuntimeException | Error e) { throw e; - } catch (Throwable rethrow) { - rethrow.printStackTrace(); - throw new RuntimeException(rethrow); + } catch (Exception e) { + throw new RuntimeException(e); } MethodHandle craftChunkGetHandle; - final MethodType type = methodType(ChunkAccess.class); + final MethodType type = methodType(LevelChunk.class); try { craftChunkGetHandle = lookup.findVirtual(CraftChunk.class, "getHandle", type); } catch (NoSuchMethodException | IllegalAccessException e) {