From ef90465d9b545da275fcc5841a5d166a0d81797a Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Thu, 19 May 2022 16:30:03 +0800 Subject: [PATCH] fix crash with official nei and foresty --- .../com/glodblock/github/nei/recipes/FluidRecipe.java | 8 ++++---- .../nei/recipes/extractor/ForestryRecipeExtractor.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/glodblock/github/nei/recipes/FluidRecipe.java b/src/main/java/com/glodblock/github/nei/recipes/FluidRecipe.java index 1060871e..b33a3b0f 100644 --- a/src/main/java/com/glodblock/github/nei/recipes/FluidRecipe.java +++ b/src/main/java/com/glodblock/github/nei/recipes/FluidRecipe.java @@ -50,16 +50,16 @@ public final class FluidRecipe { } public static List> getPackageInputsLegacy(IRecipeHandler recipe, int index) { - if (recipe == null || !IdentifierMapLegacy.containsKey(recipe.getHandlerId())) return new ArrayList<>(); - IRecipeExtractor extractor = IdentifierMapLegacy.get(recipe.getHandlerId()); + if (recipe == null || !IdentifierMapLegacy.containsKey(recipe.getClass().getName())) return new ArrayList<>(); + IRecipeExtractor extractor = IdentifierMapLegacy.get(recipe.getClass().getName()); if (extractor == null) return new ArrayList<>(); List tmp = new ArrayList<>(recipe.getIngredientStacks(index)); return extractor.getInputIngredients(tmp, recipe, index); } public static List> getPackageOutputsLegacy(IRecipeHandler recipe, int index, boolean useOther) { - if (recipe == null || !IdentifierMapLegacy.containsKey(recipe.getHandlerId())) return new ArrayList<>(); - IRecipeExtractor extractor = IdentifierMapLegacy.get(recipe.getHandlerId()); + if (recipe == null || !IdentifierMapLegacy.containsKey(recipe.getClass().getName())) return new ArrayList<>(); + IRecipeExtractor extractor = IdentifierMapLegacy.get(recipe.getClass().getName()); if (extractor == null) return new ArrayList<>(); List tmp = new ArrayList<>(Collections.singleton(recipe.getResultStack(index))); if (useOther) tmp.addAll(recipe.getOtherStacks(index)); diff --git a/src/main/java/com/glodblock/github/nei/recipes/extractor/ForestryRecipeExtractor.java b/src/main/java/com/glodblock/github/nei/recipes/extractor/ForestryRecipeExtractor.java index 15e4b130..d8f7d3c1 100644 --- a/src/main/java/com/glodblock/github/nei/recipes/extractor/ForestryRecipeExtractor.java +++ b/src/main/java/com/glodblock/github/nei/recipes/extractor/ForestryRecipeExtractor.java @@ -29,7 +29,7 @@ public class ForestryRecipeExtractor implements IRecipeExtractorLegacy { @Override public String getClassName() { - return handler.getHandlerId(); + return handler.getClass().getName(); } @Override