public class CraftingInventory extends Object implements Inventory, RecipeInputProvider
Modifier and Type | Field and Description |
---|---|
private ScreenHandler |
handler |
private int |
height |
private DefaultedList<ItemStack> |
stacks |
private int |
width |
Constructor and Description |
---|
CraftingInventory(ScreenHandler handler,
int width,
int height) |
Modifier and Type | Method and Description |
---|---|
boolean |
canPlayerUse(PlayerEntity player) |
void |
clear() |
int |
getHeight() |
ItemStack |
getStack(int slot)
Fetches the stack currently stored at the given slot.
|
int |
getWidth() |
boolean |
isEmpty() |
void |
markDirty() |
void |
provideRecipeInputs(RecipeFinder finder) |
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 |
setStack(int slot,
ItemStack stack) |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
private final DefaultedList<ItemStack> stacks
private final int width
private final int height
private final ScreenHandler handler
public CraftingInventory(ScreenHandler handler, int width, int height)
public ItemStack getStack(int slot)
ItemStack.EMPTY
.public ItemStack removeStack(int slot)
removeStack
in interface Inventory
public ItemStack removeStack(int slot, int amount)
removeStack
in interface Inventory
public void setStack(int slot, ItemStack stack)
public boolean canPlayerUse(PlayerEntity player)
canPlayerUse
in interface Inventory
public int getHeight()
public int getWidth()
public void provideRecipeInputs(RecipeFinder finder)
provideRecipeInputs
in interface RecipeInputProvider