Package net.minecraft.block
Class ComposterBlock.ComposterInventory
java.lang.Object
net.minecraft.inventory.SimpleInventory
net.minecraft.block.ComposterBlock.ComposterInventory
- All Implemented Interfaces:
Inventory,SidedInventory,RecipeInputProvider,Clearable
- Enclosing class:
- ComposterBlock
static class ComposterBlock.ComposterInventory extends SimpleInventory implements SidedInventory
-
Field Summary
Fields Modifier and Type Field Description private booleandirtyprivate BlockPosposprivate BlockStatestateprivate WorldAccessworld -
Constructor Summary
Constructors Constructor Description ComposterInventory(BlockState state, WorldAccess world, BlockPos pos) -
Method Summary
Modifier and Type Method Description booleancanExtract(int slot, ItemStack stack, Direction dir)Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.booleancanInsert(int slot, ItemStack stack, Direction dir)Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.int[]getAvailableSlots(Direction side)Gets the available slot positions that are reachable from a given side.intgetMaxCountPerStack()Returns the maximum number of items a stack can contain when placed inside this inventory.voidmarkDirty()Methods inherited from class net.minecraft.inventory.SimpleInventory
addListener, addStack, canInsert, canPlayerUse, clear, clearToList, getStack, getTags, isEmpty, provideRecipeInputs, readTags, removeItem, removeListener, removeStack, removeStack, setStack, size, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, containsAny, count, getStack, isEmpty, isValid, onClose, onOpen, removeStack, removeStack, setStack, size
-
Field Details
-
state
-
world
-
pos
-
dirty
private boolean dirty
-
-
Constructor Details
-
ComposterInventory
-
-
Method Details
-
getMaxCountPerStack
public int getMaxCountPerStack()Returns the maximum number of items a stack can contain when placed inside this inventory. No slots may have more than this number of items. It is effectively the stacking limit for this inventory's slots.- Specified by:
getMaxCountPerStackin interfaceInventory- Returns:
- the max
countof item stacks in this inventory
-
getAvailableSlots
Gets the available slot positions that are reachable from a given side.- Specified by:
getAvailableSlotsin interfaceSidedInventory
-
canInsert
Determines whether the given stack can be inserted into this inventory at the specified slot position from the given direction.- Specified by:
canInsertin interfaceSidedInventory
-
canExtract
Determines whether the given stack can be removed from this inventory at the specified slot position from the given direction.- Specified by:
canExtractin interfaceSidedInventory
-
markDirty
public void markDirty()- Specified by:
markDirtyin interfaceInventory- Overrides:
markDirtyin classSimpleInventory
-