From f21364cd3d178aef863458a2faa1f5718a4e350d Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sat, 18 Feb 2023 17:43:37 +0000 Subject: [PATCH] Update forgePatches with better exception printing --- build.gradle | 4 ++-- .../cpw/mods/fml/common/patcher/ClassPatchManager.java | 4 ++++ .../java/cpw/mods/fml/relauncher/CoreModManager.java | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index b808930..6997e9d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1676031737 +//version: 1676679815 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -677,7 +677,7 @@ dependencies { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.31') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.35') } java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} diff --git a/src/forgePatches/java/cpw/mods/fml/common/patcher/ClassPatchManager.java b/src/forgePatches/java/cpw/mods/fml/common/patcher/ClassPatchManager.java index 835c46b..71b31e6 100644 --- a/src/forgePatches/java/cpw/mods/fml/common/patcher/ClassPatchManager.java +++ b/src/forgePatches/java/cpw/mods/fml/common/patcher/ClassPatchManager.java @@ -114,6 +114,7 @@ public class ClassPatchManager { inputData = patcher.patch(inputData, patch.patch); } catch (IOException e) { FMLRelaunchLog.log(Level.ERROR, e, "Encountered problem runtime patching class %s", name); + e.printStackTrace(); continue; } } @@ -127,6 +128,7 @@ public class ClassPatchManager { Files.write(inputData, new File(tempDir, mappedName)); } catch (IOException e) { FMLRelaunchLog.log(Level.ERROR, e, "Failed to write %s to %s", mappedName, tempDir.getAbsolutePath()); + e.printStackTrace(); } } patchedClasses.put(name, inputData); @@ -156,6 +158,7 @@ public class ClassPatchManager { jis = new JarInputStream(new ByteArrayInputStream(jarBytes.toByteArray())); } catch (Exception e) { FMLRelaunchLog.log(Level.ERROR, e, "Error occurred reading binary patches. Expect severe problems!"); + e.printStackTrace(); throw Throwables.propagate(e); } @@ -189,6 +192,7 @@ public class ClassPatchManager { input = ByteStreams.newDataInput(ByteStreams.toByteArray(jis)); } catch (IOException e) { FMLRelaunchLog.log(Level.WARN, e, "Unable to read binpatch file %s - ignoring", patchEntry.getName()); + e.printStackTrace(); return null; } String name = input.readUTF(); diff --git a/src/forgePatches/java/cpw/mods/fml/relauncher/CoreModManager.java b/src/forgePatches/java/cpw/mods/fml/relauncher/CoreModManager.java index 674b9e2..d0d529b 100644 --- a/src/forgePatches/java/cpw/mods/fml/relauncher/CoreModManager.java +++ b/src/forgePatches/java/cpw/mods/fml/relauncher/CoreModManager.java @@ -173,6 +173,7 @@ public class CoreModManager { Level.ERROR, e, "The patch transformer failed to load! This is critical, loading cannot continue!"); + e.printStackTrace(); throw Throwables.propagate(e); } @@ -300,6 +301,7 @@ public class CoreModManager { mfAttributes = jar.getManifest().getMainAttributes(); } catch (IOException ioe) { FMLRelaunchLog.log(Level.ERROR, ioe, "Unable to read the jar file %s - ignoring", coreMod.getName()); + ioe.printStackTrace(); continue; } finally { if (jar != null) { @@ -363,6 +365,7 @@ public class CoreModManager { } } catch (MalformedURLException e) { FMLRelaunchLog.log(Level.ERROR, e, "Unable to convert file into a URL. weird"); + e.printStackTrace(); continue; } loadCoreMod(classLoader, fmlCorePlugin, coreMod); @@ -416,6 +419,7 @@ public class CoreModManager { e, "There was a problem trying to load the mod dir tweaker %s", coreMod.getAbsolutePath()); + e.printStackTrace(); } } @@ -526,6 +530,7 @@ public class CoreModManager { "Coremod %s: The plugin %s is not an implementor of IFMLLoadingPlugin", coreModName, coreModClass); + cce.printStackTrace(); } catch (InstantiationException ie) { FMLRelaunchLog.log( Level.ERROR, @@ -533,6 +538,7 @@ public class CoreModManager { "Coremod %s: The plugin class %s was not instantiable", coreModName, coreModClass); + ie.printStackTrace(); } catch (IllegalAccessException iae) { FMLRelaunchLog.log( Level.ERROR, @@ -540,6 +546,7 @@ public class CoreModManager { "Coremod %s: The plugin class %s was not accessible", coreModName, coreModClass); + iae.printStackTrace(); } return null; } @@ -571,6 +578,7 @@ public class CoreModManager { FMLRelaunchLog.fine("Sorted coremod list %s", loadPlugins); } catch (Exception e) { FMLLog.log(Level.ERROR, e, "There was a problem performing the coremod sort"); + e.printStackTrace(); throw Throwables.propagate(e); } }