Class CompoundContainer
java.lang.Object
net.minecraft.world.CompoundContainer
- All Implemented Interfaces:
Iterable<ItemStack>, Clearable, Container, SlotProvider, ContainerExtension
-
Nested Class Summary
Nested classes/interfaces inherited from interface Container
Container.ContainerIterator -
Field Summary
FieldsFields inherited from interface Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceItem(int slot, ItemStack itemStack) Returnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot.voidbooleanReturn whether the given inventory is part of this large chest.intgetItem(int slot) Returns the stack in the given slot.intbooleanisEmpty()removeItem(int slot, int count) Removes up to a specified number of items from an inventory slot and returns them in a new stack.removeItemNoUpdate(int slot) 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).voidstartOpen(ContainerUser containerUser) booleanstillValid(Player player) Don't rename this method to canInteractWith due to conflicts with ContainervoidstopOpen(ContainerUser containerUser) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Container
canTakeItem, countItem, getEntitiesWithContainerOpen, getMaxStackSize, getSlot, hasAnyMatching, hasAnyOf, iteratorMethods inherited from interface ContainerExtension
onTransfer, setItemMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface SlotProvider
getSlotsFromRange
-
Field Details
-
container1
-
container2
-
-
Constructor Details
-
CompoundContainer
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfaceContainer
-
isEmpty
-
contains
Return whether the given inventory is part of this large chest. -
getItem
-
removeItem
Removes up to a specified number of items from an inventory slot and returns them in a new stack.- Specified by:
removeItemin interfaceContainer
-
removeItemNoUpdate
Removes a stack from the given slot and returns it.- Specified by:
removeItemNoUpdatein interfaceContainer
-
setItem
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfaceContainer
-
setChanged
public void setChanged()- Specified by:
setChangedin interfaceContainer
-
stillValid
Don't rename this method to canInteractWith due to conflicts with Container- Specified by:
stillValidin interfaceContainer
-
startOpen
-
stopOpen
-
canPlaceItem
Returnstrueif automation is allowed to insert the given stack (ignoring stack size) into the given slot. For guis use Slot.isItemValid- Specified by:
canPlaceItemin interfaceContainer
-
clearContent
public void clearContent()- Specified by:
clearContentin interfaceClearable
-