From b97d5045b6899823eaa06b381d6bd3f2b28f93d4 Mon Sep 17 00:00:00 2001 From: Murilo Henrique Ghignatti Date: Wed, 13 Sep 2023 21:53:17 -0300 Subject: [PATCH] Proper error catching (regarding Quilt) When the mod is loaded by quilt and you try to get the path using this method an IllegalArgumentException is thrown, I think that quilt is not loading the mod as a file so this is why you are getting this error. --- fabric-1.20/src/main/java/org/dynmap/fabric_1_20/DynmapMod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/DynmapMod.java b/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/DynmapMod.java index 2ae5abd5..e178a2b3 100644 --- a/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/DynmapMod.java +++ b/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/DynmapMod.java @@ -30,7 +30,7 @@ public class DynmapMod implements ModInitializer { Path path = MOD_CONTAINER.getRootPath(); try { jarfile = new File(DynmapCore.class.getProtectionDomain().getCodeSource().getLocation().toURI()); - } catch (URISyntaxException e) { + } catch (URISyntaxException | IllegalArgumentException e) { Log.severe("Unable to get DynmapCore jar path", e); }