public interface IRecipeTransferHandler<C extends net.minecraft.inventory.Container>
Implementing this interface gives full control over the recipe transfer process.
Mods that use a regular slotted inventory can use IRecipeTransferInfo
instead, which is much simpler.
Useful functions for implementing a recipe transfer handler can be found in IRecipeTransferHandlerHelper
.
To register your recipe transfer handler, use IRecipeTransferRegistry.addRecipeTransferHandler(IRecipeTransferHandler, String)
.
Modifier and Type | Method and Description |
---|---|
java.lang.Class<C> |
getContainerClass()
The container that this recipe transfer handler can use.
|
IRecipeTransferError |
transferRecipe(C container,
IRecipeLayout recipeLayout,
net.minecraft.entity.player.EntityPlayer player,
boolean maxTransfer,
boolean doTransfer) |
java.lang.Class<C> getContainerClass()
@Nullable IRecipeTransferError transferRecipe(C container, IRecipeLayout recipeLayout, net.minecraft.entity.player.EntityPlayer player, boolean maxTransfer, boolean doTransfer)
container
- the container to act onrecipeLayout
- the layout of the recipe, with information about the ingredientsplayer
- the player, to do the slot manipulationmaxTransfer
- if true, transfer as many items as possible. if false, transfer one setdoTransfer
- if true, do the transfer. if false, check for errors but do not actually transfer the items