From 0b491f26fc068fb3ede6953717108c9221bd38e5 Mon Sep 17 00:00:00 2001 From: mezz Date: Sun, 8 Jan 2017 03:36:43 -0800 Subject: [PATCH] Fix #1561 Crash when using the carpenter --- .../java/forestry/api/recipes/IDescriptiveRecipe.java | 6 +++++- .../java/forestry/core/recipes/ShapedRecipeCustom.java | 5 +++++ .../recipes/jei/carpenter/CarpenterRecipeWrapper.java | 2 +- src/main/java/forestry/factory/tiles/TileCarpenter.java | 8 ++++---- .../java/forestry/farming/multiblock/FarmController.java | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/java/forestry/api/recipes/IDescriptiveRecipe.java b/src/main/java/forestry/api/recipes/IDescriptiveRecipe.java index 36dd2fdcb..9c413d07a 100644 --- a/src/main/java/forestry/api/recipes/IDescriptiveRecipe.java +++ b/src/main/java/forestry/api/recipes/IDescriptiveRecipe.java @@ -6,6 +6,7 @@ package forestry.api.recipes; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.NonNullList; /** @@ -33,5 +34,8 @@ public interface IDescriptiveRecipe { NonNullList getOreDicts(); - ItemStack getRecipeOutput(); + /** + * Must not be named the same as {@link IRecipe#getRecipeOutput()} to avoid obfuscation for recipes that implement both. + */ + ItemStack getOutput(); } diff --git a/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java b/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java index 654e6d605..676163bb0 100644 --- a/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java +++ b/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java @@ -148,6 +148,11 @@ public class ShapedRecipeCustom extends ShapedOreRecipe implements IDescriptiveR return oreDicts; } + @Override + public ItemStack getOutput() { + return getRecipeOutput(); + } + @Override public boolean matches(InventoryCrafting inv, World world) { for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++) { diff --git a/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeWrapper.java b/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeWrapper.java index ca1c82a4a..d628d9c1b 100644 --- a/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeWrapper.java +++ b/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeWrapper.java @@ -49,7 +49,7 @@ public class CarpenterRecipeWrapper extends ForestryRecipeWrapper