Package net.minecraftforge.items.wrapper
Class RecipeWrapper
- java.lang.Object
-
- net.minecraftforge.items.wrapper.RecipeWrapper
-
- All Implemented Interfaces:
IClearable
,IInventory
public class RecipeWrapper extends java.lang.Object implements IInventory
-
-
Field Summary
Fields Modifier and Type Field Description protected IItemHandlerModifiable
inv
-
Constructor Summary
Constructors Constructor Description RecipeWrapper(IItemHandlerModifiable inv)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canPlaceItem(int slot, ItemStack stack)
void
clearContent()
int
getContainerSize()
Returns the size of this inventory.ItemStack
getItem(int slot)
Returns the stack in this slot.int
getMaxStackSize()
boolean
isEmpty()
ItemStack
removeItem(int slot, int count)
Attempts to remove n items from the specified slot.ItemStack
removeItemNoUpdate(int index)
Removes the stack contained in this slot from the underlying handler, and returns it.void
setChanged()
void
setItem(int slot, ItemStack stack)
Sets the contents of this slot to the provided stack.void
startOpen(PlayerEntity player)
boolean
stillValid(PlayerEntity player)
void
stopOpen(PlayerEntity player)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraft.inventory.IInventory
countItem, hasAnyOf
-
-
-
-
Field Detail
-
inv
protected final IItemHandlerModifiable inv
-
-
Constructor Detail
-
RecipeWrapper
public RecipeWrapper(IItemHandlerModifiable inv)
-
-
Method Detail
-
getContainerSize
public int getContainerSize()
Returns the size of this inventory. Must be equivalent to#getHeight()
*#getWidth()
.- Specified by:
getContainerSize
in interfaceIInventory
-
getItem
public ItemStack getItem(int slot)
Returns the stack in this slot. This stack should be a modifiable reference, not a copy of a stack in your inventory.- Specified by:
getItem
in interfaceIInventory
-
removeItem
public ItemStack removeItem(int slot, int count)
Attempts to remove n items from the specified slot. Returns the split stack that was removed. Modifies the inventory.- Specified by:
removeItem
in interfaceIInventory
-
setItem
public void setItem(int slot, ItemStack stack)
Sets the contents of this slot to the provided stack.- Specified by:
setItem
in interfaceIInventory
-
removeItemNoUpdate
public ItemStack removeItemNoUpdate(int index)
Removes the stack contained in this slot from the underlying handler, and returns it.- Specified by:
removeItemNoUpdate
in interfaceIInventory
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceIInventory
-
canPlaceItem
public boolean canPlaceItem(int slot, ItemStack stack)
- Specified by:
canPlaceItem
in interfaceIInventory
-
clearContent
public void clearContent()
- Specified by:
clearContent
in interfaceIClearable
-
getMaxStackSize
public int getMaxStackSize()
- Specified by:
getMaxStackSize
in interfaceIInventory
-
setChanged
public void setChanged()
- Specified by:
setChanged
in interfaceIInventory
-
stillValid
public boolean stillValid(PlayerEntity player)
- Specified by:
stillValid
in interfaceIInventory
-
startOpen
public void startOpen(PlayerEntity player)
- Specified by:
startOpen
in interfaceIInventory
-
stopOpen
public void stopOpen(PlayerEntity player)
- Specified by:
stopOpen
in interfaceIInventory
-
-