public class CraftingResultInventory extends Object implements Inventory, RecipeUnlocker
Modifier and Type | Field and Description |
---|---|
private Recipe<?> |
lastRecipe |
private DefaultedList<ItemStack> |
stacks |
Constructor and Description |
---|
CraftingResultInventory() |
Modifier and Type | Method and 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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
shouldCraftRecipe, unlockLastRecipe
private final DefaultedList<ItemStack> stacks
public ItemStack getStack(int slot)
ItemStack.EMPTY
.public ItemStack removeStack(int slot, int amount)
removeStack
in interface Inventory
public ItemStack removeStack(int slot)
removeStack
in interface Inventory
public void setStack(int slot, ItemStack stack)
public boolean canPlayerUse(PlayerEntity player)
canPlayerUse
in interface Inventory
public void setLastRecipe(@Nullable Recipe<?> recipe)
setLastRecipe
in interface RecipeUnlocker
@Nullable public Recipe<?> getLastRecipe()
getLastRecipe
in interface RecipeUnlocker