Class ItemHandlerContainer
java.lang.Object
com.simibubi.create.foundation.blockEntity.ItemHandlerContainer
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container
- Direct Known Subclasses:
SmartInventory,StorageInteractionWrapper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final net.neoforged.neoforge.items.IItemHandlerModifiableFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsConstructorDescriptionItemHandlerContainer(net.neoforged.neoforge.items.IItemHandlerModifiable inv) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceItem(int slot, net.minecraft.world.item.ItemStack stack) voidintReturns the size of this inventory.net.minecraft.world.item.ItemStackgetItem(int slot) Returns the stack in this slot.intbooleanisEmpty()net.minecraft.world.item.ItemStackremoveItem(int slot, int count) Attempts to remove n items from the specified slot.net.minecraft.world.item.ItemStackremoveItemNoUpdate(int index) Removes the stack contained in this slot from the underlying handler, and returns it.voidvoidsetItem(int slot, net.minecraft.world.item.ItemStack stack) Sets the contents of this slot to the provided stack.voidstartOpen(net.minecraft.world.entity.player.Player player) booleanstillValid(net.minecraft.world.entity.player.Player player) voidstopOpen(net.minecraft.world.entity.player.Player player) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf
-
Field Details
-
inv
protected final net.neoforged.neoforge.items.IItemHandlerModifiable inv
-
-
Constructor Details
-
ItemHandlerContainer
public ItemHandlerContainer(net.neoforged.neoforge.items.IItemHandlerModifiable inv)
-
-
Method Details
-
getContainerSize
public int getContainerSize()Returns the size of this inventory.- Specified by:
getContainerSizein interfacenet.minecraft.world.Container
-
getItem
public net.minecraft.world.item.ItemStack getItem(int slot) Returns the stack in this slot. This stack should be a modifiable reference, not a copy of a stack in your inventory.- Specified by:
getItemin interfacenet.minecraft.world.Container
-
removeItem
public net.minecraft.world.item.ItemStack removeItem(int slot, int count) Attempts to remove n items from the specified slot. Returns the split stack that was removed. Modifies the inventory.- Specified by:
removeItemin interfacenet.minecraft.world.Container
-
setItem
public void setItem(int slot, net.minecraft.world.item.ItemStack stack) Sets the contents of this slot to the provided stack.- Specified by:
setItemin interfacenet.minecraft.world.Container
-
removeItemNoUpdate
public net.minecraft.world.item.ItemStack removeItemNoUpdate(int index) Removes the stack contained in this slot from the underlying handler, and returns it.- Specified by:
removeItemNoUpdatein interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.world.Container
-
canPlaceItem
public boolean canPlaceItem(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
canPlaceItemin interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfacenet.minecraft.world.Container
-
setChanged
public void setChanged()- Specified by:
setChangedin interfacenet.minecraft.world.Container
-
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) - Specified by:
stillValidin interfacenet.minecraft.world.Container
-
startOpen
public void startOpen(net.minecraft.world.entity.player.Player player) - Specified by:
startOpenin interfacenet.minecraft.world.Container
-
stopOpen
public void stopOpen(net.minecraft.world.entity.player.Player player) - Specified by:
stopOpenin interfacenet.minecraft.world.Container
-