Package net.minecraft.inventory
Class CraftingResultInventory
java.lang.Object
net.minecraft.inventory.CraftingResultInventory
- All Implemented Interfaces:
Inventory,RecipeUnlocker,Clearable
public class CraftingResultInventory extends Object implements Inventory, RecipeUnlocker
-
Field Summary
Fields Modifier and Type Field Description private Recipe<?>lastRecipeprivate DefaultedList<ItemStack>stacks -
Constructor Summary
Constructors Constructor Description CraftingResultInventory() -
Method Summary
Modifier and Type Method Description booleancanPlayerUse(PlayerEntity player)voidclear()Recipe<?>getLastRecipe()ItemStackgetStack(int slot)Fetches the stack currently stored at the given slot.booleanisEmpty()voidmarkDirty()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.voidsetLastRecipe(Recipe<?> recipe)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, onOpenMethods inherited from interface net.minecraft.recipe.RecipeUnlocker
shouldCraftRecipe, unlockLastRecipe
-
Field Details
-
stacks
-
lastRecipe
-
-
Constructor Details
-
CraftingResultInventory
public CraftingResultInventory()
-
-
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 a specific number of items from the given slot.- Specified by:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
-
removeStack
Removes the stack currently stored at the indicated slot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot.
-
setStack
-
markDirty
public void markDirty() -
canPlayerUse
- Specified by:
canPlayerUsein interfaceInventory
-
clear
public void clear() -
setLastRecipe
- Specified by:
setLastRecipein interfaceRecipeUnlocker
-
getLastRecipe
- Specified by:
getLastRecipein interfaceRecipeUnlocker
-