From 438a306bd10cf9569ee8860ec7927cda0717ef50 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:24:07 -0400 Subject: [PATCH 1/3] Suppress error message in AbstractJarFileDependencyLocator if NSFE is thrown --- .../loading/moddiscovery/AbstractJarFileDependencyLocator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileDependencyLocator.java b/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileDependencyLocator.java index d715e833e..d683f8802 100644 --- a/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileDependencyLocator.java +++ b/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileDependencyLocator.java @@ -14,6 +14,7 @@ import java.io.FileNotFoundException; import java.io.InputStream; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.Optional; @@ -25,7 +26,7 @@ protected Optional loadResourceFromModFile(final IModFile modFile, try { return Optional.of(Files.newInputStream(modFile.findResource(path.toString()))); } - catch (final FileNotFoundException e) { + catch (final FileNotFoundException | NoSuchFileException e) { LOGGER.debug("Failed to load resource {} from {}, it does not contain dependency information.", path, modFile.getFileName()); return Optional.empty(); } From ebfa3f54733d0e1d9e370b5be7ced2d95f6cf226 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Mon, 4 Mar 2024 03:01:21 -0500 Subject: [PATCH 2/3] Only log errors when scanning mod file contents --- .../net/minecraftforge/fml/loading/moddiscovery/Scanner.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/Scanner.java b/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/Scanner.java index 88ae4e9c5..5fddd3473 100644 --- a/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/Scanner.java +++ b/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/Scanner.java @@ -45,14 +45,13 @@ public ModFileScanData scan() { } private void fileVisitor(final Path path, final ModFileScanData result) { - LOGGER.debug(LogMarkers.SCAN,"Scanning {} path {}", fileToScan, path); try (InputStream in = Files.newInputStream(path)){ ModClassVisitor mcv = new ModClassVisitor(); ClassReader cr = new ClassReader(in); cr.accept(mcv, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG); mcv.buildData(result.getClasses(), result.getAnnotations()); } catch (IOException | IllegalArgumentException e) { - // mark path bad + LOGGER.error(LogMarkers.SCAN,"Exception scanning {} path {}", fileToScan, path, e); } } } From b742bdbd3f00a435901168446f4248c86a26c010 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Sun, 24 Mar 2024 13:01:29 -0400 Subject: [PATCH 3/3] Change debug to trace --- .../loading/moddiscovery/AbstractJarFileDependencyLocator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileDependencyLocator.java b/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileDependencyLocator.java index d683f8802..5fb808fe4 100644 --- a/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileDependencyLocator.java +++ b/loader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/AbstractJarFileDependencyLocator.java @@ -27,7 +27,7 @@ protected Optional loadResourceFromModFile(final IModFile modFile, return Optional.of(Files.newInputStream(modFile.findResource(path.toString()))); } catch (final FileNotFoundException | NoSuchFileException e) { - LOGGER.debug("Failed to load resource {} from {}, it does not contain dependency information.", path, modFile.getFileName()); + LOGGER.trace("Failed to load resource {} from {}, it does not contain dependency information.", path, modFile.getFileName()); return Optional.empty(); } catch (final Exception e) {