Package org.moddingx.libx.inventory
Class BaseItemStackHandler.Builder
java.lang.Object
org.moddingx.libx.inventory.BaseItemStackHandler.Builder
- Enclosing class:
- BaseItemStackHandler
Builder for a
BaseItemStackHandler
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the item handler.contentsChanged
(Runnable action) Adds an action that runs whenever the contents of the inventory change.contentsChanged
(Consumer<Integer> action) Adds an action that runs whenever the contents of the inventory change.defaultSlotLimit
(int defaultSlotLimit) Sets the default maximum stack size for the item handler.insertionOnly
(int... slots) Marks the given slots as insertion only.insertionOnly
(Range<Integer> slots) Marks the given slots as insertion only.insertionOnly
(Set<Integer> slots) Marks the given slots as insertion only.output
(int... slots) Marks the given slots as outputs.Marks the given slots as outputs.Marks the given slots as outputs.slotLimit
(int slotLimit, int... slots) Sets a maximum stack size for some slots.Sets a maximum stack size for some slots.Sets a maximum stack size for some slots.Sets a slot validator for some slots.Sets a slot validator for some slots.Sets a slot validator for some slots.
-
Method Details
-
contentsChanged
Adds an action that runs whenever the contents of the inventory change. -
contentsChanged
Adds an action that runs whenever the contents of the inventory change. The action will get passed the slot that was changed. -
output
Marks the given slots as outputs. That means it's not possible to insert items into these slots. Marking a slot as insertion only and output at the same time will cause an exception. -
output
Marks the given slots as outputs. That means it's not possible to insert items into these slots. Marking a slot as insertion only and output at the same time will cause an exception. -
output
Marks the given slots as outputs. That means it's not possible to insert items into these slots. Marking a slot as insertion only and output at the same time will cause an exception. -
insertionOnly
Marks the given slots as insertion only. That means it's not possible to extract items from these slots. Marking a slot as insertion only and output at the same time will cause an exception. -
insertionOnly
Marks the given slots as insertion only. That means it's not possible to extract items from these slots. Marking a slot as insertion only and output at the same time will cause an exception. -
insertionOnly
Marks the given slots as insertion only. That means it's not possible to extract items from these slots. Marking a slot as insertion only and output at the same time will cause an exception. -
defaultSlotLimit
Sets the default maximum stack size for the item handler. -
slotLimit
Sets a maximum stack size for some slots. -
slotLimit
Sets a maximum stack size for some slots. -
slotLimit
Sets a maximum stack size for some slots. -
validator
public BaseItemStackHandler.Builder validator(Predicate<net.minecraft.world.item.ItemStack> validator, int... slots) Sets a slot validator for some slots. -
validator
public BaseItemStackHandler.Builder validator(Predicate<net.minecraft.world.item.ItemStack> validator, Set<Integer> slots) Sets a slot validator for some slots. -
validator
public BaseItemStackHandler.Builder validator(Predicate<net.minecraft.world.item.ItemStack> validator, Range<Integer> slots) Sets a slot validator for some slots. -
build
Build the item handler.
-