public interface IItemTransactor
Modifier and Type | Interface and Description |
---|---|
static interface |
IItemTransactor.IItemExtractable |
static interface |
IItemTransactor.IItemInsertable |
Modifier and Type | Method and Description |
---|---|
default boolean |
canFullyAccept(net.minecraft.item.ItemStack stack) |
default boolean |
canPartiallyAccept(net.minecraft.item.ItemStack stack) |
net.minecraft.item.ItemStack |
extract(IStackFilter filter,
int min,
int max,
boolean simulate)
Extracts a number of items that match the given filter
|
net.minecraft.item.ItemStack |
insert(net.minecraft.item.ItemStack stack,
boolean allOrNone,
boolean simulate) |
default net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> |
insert(net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> stacks,
boolean simulate)
Similar to
insert(ItemStack, boolean, boolean) but probably be more efficient at inserting lots of
items. |
@Nonnull net.minecraft.item.ItemStack insert(@Nonnull net.minecraft.item.ItemStack stack, boolean allOrNone, boolean simulate)
stack
- The stack to insert. Must not be null!allOrNone
- If true then either the entire stack will be used or none of it.simulate
- If true then the in-world state of this will not be changed.ItemStack.EMPTY
if all of it was accepted.default net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> insert(net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> stacks, boolean simulate)
insert(ItemStack, boolean, boolean)
but probably be more efficient at inserting lots of
items.stacks
- The stacks to insert. Must not be null!simulate
- If true then the in-world state of this will not be changed.@Nonnull net.minecraft.item.ItemStack extract(@Nullable IStackFilter filter, int min, int max, boolean simulate)
filter
- The filter that MUST be met by the extracted stack. Null means no filter - it can be any item.min
- The minimum number of items to extract, or 0 if not enough items can be extractedmax
- The maximum number of items to extract.simulate
- If true then the in-world state of this will not be changed.ItemStack.EMPTY
if it could not be.default boolean canFullyAccept(@Nonnull net.minecraft.item.ItemStack stack)
default boolean canPartiallyAccept(@Nonnull net.minecraft.item.ItemStack stack)