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 intprivate final NonNullList<ItemStack> private final AbstractContainerMenuprivate final intFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsModifierConstructorDescriptionTransientCraftingContainer(AbstractContainerMenu pMenu, int pWidth, int pHeight) privateTransientCraftingContainer(AbstractContainerMenu pMenu, int pWidth, int pHeight, NonNullList<ItemStack> pItems) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidfillStackedContents(StackedItemContents p_362501_) intintgetItem(int p_287712_) Returns the stack in the given slot.getItems()intgetWidth()booleanisEmpty()removeItem(int p_287682_, int p_287576_) Removes up to a specified number of items from an inventory slot and returns them in a new stack.removeItemNoUpdate(int p_287637_) Removes a stack from the given slot and returns it.voidvoidSets the given item stack to the specified slot in the inventory (can be crafting or armor sections).booleanstillValid(Player p_287774_) 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, waitMethods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpenMethods 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
private TransientCraftingContainer(AbstractContainerMenu pMenu, int pWidth, int pHeight, NonNullList<ItemStack> pItems)
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfaceContainer
-
isEmpty
public boolean isEmpty() -
getItem
Description copied from interface:ContainerReturns the stack in the given slot. -
removeItemNoUpdate
Description copied from interface:ContainerRemoves a stack from the given slot and returns it.- Specified by:
removeItemNoUpdatein interfaceContainer
-
removeItem
Description copied from interface:ContainerRemoves up to a specified number of items from an inventory slot and returns them in a new stack.- Specified by:
removeItemin interfaceContainer
-
setItem
Description copied from interface:ContainerSets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -
setChanged
public void setChanged()- Specified by:
setChangedin interfaceContainer
-
stillValid
Description copied from interface:ContainerDon't rename this method to canInteractWith due to conflicts with Container- Specified by:
stillValidin interfaceContainer
-
clearContent
public void clearContent()- Specified by:
clearContentin interfaceClearable
-
getHeight
public int getHeight()- Specified by:
getHeightin interfaceCraftingContainer
-
getWidth
public int getWidth()- Specified by:
getWidthin interfaceCraftingContainer
-
getItems
- Specified by:
getItemsin interfaceCraftingContainer
-
fillStackedContents
- Specified by:
fillStackedContentsin interfaceStackedContentsCompatible
-