From 6070b21d0e843aecaa032f473dc293382f860f0a Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sat, 20 Nov 2021 15:14:36 +0800 Subject: Fix REIClientPlugins on servers --- .../main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'forge/src') diff --git a/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java b/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java index 8f67f2bff..e2b13d7bc 100644 --- a/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java +++ b/forge/src/main/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForge.java @@ -68,6 +68,7 @@ public class RoughlyEnoughItemsForge { .flatMap(info -> info.getMods().stream()) .map(IModInfo::getModId) .collect(Collectors.toList()); + out: for (ModFileScanData.AnnotationData annotation : data.getAnnotations()) { if (annotationType.equals(annotation.annotationType())) { try { @@ -83,6 +84,12 @@ public class RoughlyEnoughItemsForge { }, clazz)); } } catch (Throwable throwable) { + Throwable t = throwable; + while (t != null) { + if (t.getMessage() != null && t.getMessage().contains("invalid dist DEDICATED_SERVER") && !RoughlyEnoughItemsInitializer.isClient()) + continue out; + t = t.getCause(); + } LOGGER.error("Failed to load plugin: " + annotation.memberName(), throwable); } } -- cgit