diff --git a/src/main/java/slimeknights/mantle/recipe/ICommonRecipe.java b/src/main/java/slimeknights/mantle/recipe/ICommonRecipe.java new file mode 100644 index 0000000..d9696fd --- /dev/null +++ b/src/main/java/slimeknights/mantle/recipe/ICommonRecipe.java @@ -0,0 +1,32 @@ +package slimeknights.mantle.recipe; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; + +/** + * Extension of {@link IRecipe} to set some methods that always set. + * @param Inventory type + */ +public interface ICommonRecipe extends IRecipe { + @Override + default ItemStack getCraftingResult(C inv) { + return getRecipeOutput().copy(); + } + + /** @deprecated Means nothing outside of crafting tables */ + @Deprecated + @Override + default boolean canFit(int width, int height) { + return true; + } + + /** + * Returns true to hide this recipe from the recipe book. Needed until Forge has proper recipe book support. + * @return True + */ + @Override + default boolean isDynamic() { + return true; + } +} diff --git a/src/main/java/slimeknights/mantle/recipe/ICustomOutputRecipe.java b/src/main/java/slimeknights/mantle/recipe/ICustomOutputRecipe.java new file mode 100644 index 0000000..cddd301 --- /dev/null +++ b/src/main/java/slimeknights/mantle/recipe/ICustomOutputRecipe.java @@ -0,0 +1,24 @@ +package slimeknights.mantle.recipe; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +/** + * Recipe that has an output other than an {@link ItemStack} + * @param Inventory type + */ +public interface ICustomOutputRecipe extends ICommonRecipe { + /** @deprecated Item stack output not supported */ + @Override + @Deprecated + default ItemStack getRecipeOutput() { + return ItemStack.EMPTY; + } + + /** @deprecated Item stack output not supported */ + @Override + @Deprecated + default ItemStack getCraftingResult(C inv) { + return ItemStack.EMPTY; + } +}