T
- the type of IRecipe
handledpublic abstract class RecipeHandler<T extends net.minecraft.item.crafting.IRecipe>
extends java.lang.Object
Constructor and Description |
---|
RecipeHandler(java.lang.Class<T> clazz) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.reflect.Field |
changeAccess(java.lang.Class clazz,
java.lang.String fieldName)
Changes the access level for the specified field for a class.
|
static RecipeHandler |
getHandler(net.minecraft.item.crafting.IRecipe recipe)
Gets the handler of a specific
IRecipe . |
protected net.minecraft.item.ItemStack |
getItemStack(java.lang.Object obj)
Gets the
ItemStack corresponding to the object. |
protected boolean |
isMatched(net.minecraft.item.ItemStack itemStack,
java.lang.Object replaced)
Checks if the object matches the speicified
ItemStack . |
abstract void |
replace(T recipe,
java.lang.Object vanilla,
java.lang.Object replacement) |
public RecipeHandler(java.lang.Class<T> clazz)
protected java.lang.reflect.Field changeAccess(java.lang.Class clazz, java.lang.String fieldName)
clazz
- the clazzfieldName
- the field nameprotected net.minecraft.item.ItemStack getItemStack(java.lang.Object obj)
ItemStack
corresponding to the object. Obj is either Item
or Block
.obj
- the replacementprotected boolean isMatched(net.minecraft.item.ItemStack itemStack, java.lang.Object replaced)
ItemStack
.itemStack
- the item stackreplaced
- the replacedpublic abstract void replace(T recipe, java.lang.Object vanilla, java.lang.Object replacement)
public static RecipeHandler getHandler(net.minecraft.item.crafting.IRecipe recipe)
IRecipe
.recipe
- the recipe