Package net.minecraft.world.inventory
Class TransientCraftingContainer
java.lang.Object
net.minecraft.world.inventory.TransientCraftingContainer
- All Implemented Interfaces:
Clearable
,Container
,CraftingContainer
,StackedContentsCompatible
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final NonNullList
<ItemStack> private final AbstractContainerMenu
private final int
Fields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER
-
Constructor Summary
ConstructorsConstructorDescriptionTransientCraftingContainer
(AbstractContainerMenu pMenu, int pWidth, int pHeight) TransientCraftingContainer
(AbstractContainerMenu pMenu, int pWidth, int pHeight, NonNullList<ItemStack> pItems) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
fillStackedContents
(StackedContents pContents) int
int
getItem
(int pSlot) Returns the stack in the given slot.getItems()
int
getWidth()
boolean
isEmpty()
removeItem
(int pSlot, int pAmount) Removes up to a specified number of items from an inventory slot and returns them in a new stack.removeItemNoUpdate
(int pSlot) Removes a stack from the given slot and returns it.void
void
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).boolean
stillValid
(Player pPlayer) Don't rename this method to canInteractWith due to conflicts with ContainerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpen
Methods inherited from interface net.minecraft.world.inventory.CraftingContainer
asCraftInput, asPositionedCraftInput
-
Field Details
-
items
-
width
private final int width -
height
private final int height
-
-
Constructor Details
-
TransientCraftingContainer
-
TransientCraftingContainer
public TransientCraftingContainer(AbstractContainerMenu pMenu, int pWidth, int pHeight, NonNullList<ItemStack> pItems)
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSize
in interfaceContainer
-
isEmpty
public boolean isEmpty() -
getItem
Returns the stack in the given slot. -
removeItemNoUpdate
Removes a stack from the given slot and returns it.- Specified by:
removeItemNoUpdate
in interfaceContainer
-
removeItem
Removes up to a specified number of items from an inventory slot and returns them in a new stack.- Specified by:
removeItem
in interfaceContainer
-
setItem
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -
setChanged
public void setChanged()- Specified by:
setChanged
in interfaceContainer
-
stillValid
Don't rename this method to canInteractWith due to conflicts with Container- Specified by:
stillValid
in interfaceContainer
-
clearContent
public void clearContent()- Specified by:
clearContent
in interfaceClearable
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceCraftingContainer
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceCraftingContainer
-
getItems
- Specified by:
getItems
in interfaceCraftingContainer
-
fillStackedContents
- Specified by:
fillStackedContents
in interfaceStackedContentsCompatible
-