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<?>
lastRecipe
private DefaultedList<ItemStack>
stacks
-
Constructor Summary
Constructors Constructor Description CraftingResultInventory()
-
Method Summary
Modifier and Type Method Description boolean
canPlayerUse(PlayerEntity player)
void
clear()
Recipe<?>
getLastRecipe()
ItemStack
getStack(int slot)
Fetches the stack currently stored at the given slot.boolean
isEmpty()
void
markDirty()
ItemStack
removeStack(int slot)
Removes the stack currently stored at the indicated slot.ItemStack
removeStack(int slot, int amount)
Removes a specific number of items from the given slot.void
setLastRecipe(Recipe<?> recipe)
void
setStack(int slot, ItemStack stack)
int
size()
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.Inventory
containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
Methods 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:
removeStack
in interfaceInventory
- Returns:
- the removed items as a stack
-
removeStack
Removes the stack currently stored at the indicated slot.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the stack previously stored at the indicated slot.
-
setStack
-
markDirty
public void markDirty() -
canPlayerUse
- Specified by:
canPlayerUse
in interfaceInventory
-
clear
public void clear() -
setLastRecipe
- Specified by:
setLastRecipe
in interfaceRecipeUnlocker
-
getLastRecipe
- Specified by:
getLastRecipe
in interfaceRecipeUnlocker
-