Add a couple interfaces because Mojang adds too many methods to recipe interfaces

This commit is contained in:
KnightMiner committed 2020-08-10 13:08:57 -05:00
1 parent 2763a5b584
commit 46218ffbc4
2 files changed
+56

No files matched your search

@@ -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 <C> Inventory type
*/
public interface ICommonRecipe<C extends IInventory> extends IRecipe<C> {
@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;
}
}
@@ -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 <C> Inventory type
*/
public interface ICustomOutputRecipe<C extends IInventory> extends ICommonRecipe<C> {
/** @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;
}
}