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/main/java') 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 From 30eb93c91f00c6cf8a3809ff72fa9bedaaebbc92 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Sun, 21 Nov 2021 11:49:06 +0800 Subject: Fix EnderStorage recipes --- .../crafting/forge/DefaultCraftingDisplayImpl.java | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java (limited to 'forge/src/main/java') diff --git a/forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java b/forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java new file mode 100644 index 000000000..fe2b36fcc --- /dev/null +++ b/forge/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/forge/DefaultCraftingDisplayImpl.java @@ -0,0 +1,38 @@ +/* + * This file is licensed under the MIT License, part of Roughly Enough Items. + * Copyright (c) 2018, 2019, 2020, 2021 shedaniel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package me.shedaniel.rei.plugin.common.displays.crafting.forge; + +import net.minecraft.world.item.crafting.Recipe; +import net.minecraftforge.common.crafting.IShapedRecipe; +import org.apache.commons.lang3.tuple.Pair; + +public class DefaultCraftingDisplayImpl { + public static Pair getSize(Recipe recipe) { + if (recipe instanceof IShapedRecipe) { + return Pair.of(((IShapedRecipe) recipe).getRecipeWidth(), ((IShapedRecipe) recipe).getRecipeHeight()); + } + + return null; + } +} -- cgit