Package net.minecraft.inventory
Class CraftingInventory
java.lang.Object
net.minecraft.inventory.CraftingInventory
- All Implemented Interfaces:
Inventory,RecipeInputProvider,Clearable
public class CraftingInventory extends Object implements Inventory, RecipeInputProvider
-
Field Summary
Fields Modifier and Type Field Description private ScreenHandlerhandlerprivate intheightprivate DefaultedList<ItemStack>stacksprivate intwidth -
Constructor Summary
Constructors Constructor Description CraftingInventory(ScreenHandler handler, int width, int height) -
Method Summary
Modifier and Type Method Description booleancanPlayerUse(PlayerEntity player)voidclear()intgetHeight()ItemStackgetStack(int slot)Fetches the stack currently stored at the given slot.intgetWidth()booleanisEmpty()voidmarkDirty()voidprovideRecipeInputs(RecipeFinder finder)ItemStackremoveStack(int slot)Removes the stack currently stored at the indicated slot.ItemStackremoveStack(int slot, int amount)Removes a specific number of items from the given slot.voidsetStack(int slot, ItemStack stack)intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
-
Field Details
-
stacks
-
width
private final int width -
height
private final int height -
handler
-
-
Constructor Details
-
CraftingInventory
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
getStack
Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns seeItemStack.EMPTY. -
removeStack
Removes the stack currently stored at the indicated slot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot.
-
removeStack
Removes a specific number of items from the given slot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
-
setStack
-
markDirty
public void markDirty() -
canPlayerUse
- Specified by:
canPlayerUsein interfaceInventory
-
clear
public void clear() -
getHeight
public int getHeight() -
getWidth
public int getWidth() -
provideRecipeInputs
- Specified by:
provideRecipeInputsin interfaceRecipeInputProvider
-