From 7503f95117096c6d71334a4b10c9cb46ce197770 Mon Sep 17 00:00:00 2001 From: jediminer543 Date: Fri, 4 Mar 2022 12:49:33 +0000 Subject: [PATCH] Fixed issues where syncfu bypass would cause server to refuse to start --- .../modlauncher/FastUtilTransformerService.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sync-fu/src/main/java/org/jmt/mcmt/modlauncher/FastUtilTransformerService.java b/sync-fu/src/main/java/org/jmt/mcmt/modlauncher/FastUtilTransformerService.java index 70862a4a..c6fd5a0d 100644 --- a/sync-fu/src/main/java/org/jmt/mcmt/modlauncher/FastUtilTransformerService.java +++ b/sync-fu/src/main/java/org/jmt/mcmt/modlauncher/FastUtilTransformerService.java @@ -199,16 +199,23 @@ public Class loadClass(String name) throws ClassNotFoundException { try { met.invoke(null, (Object)args); } catch (java.lang.reflect.InvocationTargetException e) { - throw e.getCause(); + //throw e.getCause(); + e.printStackTrace(); } //Configuration bootstrapConfiguration = Launcher.class.getModule().getLayer().configuration(); //Configuration rebootstrapConfiguration = //ModuleClassLoader bootstrapReplacer = new ModuleClassLoader("RE-BOOTSTRAP", rebootstrapConfiguration, List.of(ModuleLayer.boot())); - System.exit(0); + // BROKEN ON SERVERS + //System.exit(0); + // Make thread sit dead + //Thread.currentThread().setDaemon(true); + Thread.currentThread().setUncaughtExceptionHandler((t, e) -> {}); + throw new Error("KILLING TO AVOID REBOOT"); //BootstrapLauncher.main(); - } catch (Throwable t) { + } catch (Exception t) { t.printStackTrace(); - System.exit(9001); + Thread.currentThread().setUncaughtExceptionHandler((thr, e) -> {}); + throw new Error("KILLING TO AVOID REBOOT"); } }