Package net.minestom.server.inventory
Interface TransactionOption<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TransactionOption
<ItemStack> Place as much as the item as possible.static final TransactionOption
<Boolean> Only place the item if can be fully added.static final TransactionOption
<Boolean> Loop through the inventory items without changing anything. -
Method Summary
Modifier and TypeMethodDescriptionfill
(@NotNull AbstractInventory inventory, @NotNull ItemStack result, @NotNull Map<@NotNull Integer, @NotNull ItemStack> itemChangesMap) default T
fill
(@NotNull TransactionType type, @NotNull AbstractInventory inventory, @NotNull ItemStack itemStack)
-
Field Details
-
ALL
Place as much as the item as possible.The remaining, can be air.
-
ALL_OR_NOTHING
Only place the item if can be fully added.Returns true if the item has been added, false if nothing changed.
-
DRY_RUN
Loop through the inventory items without changing anything.Returns true if the item can be fully added, false otherwise.
-
-
Method Details
-
fill
-
fill
@NotNull default T fill(@NotNull @NotNull TransactionType type, @NotNull @NotNull AbstractInventory inventory, @NotNull @NotNull ItemStack itemStack)
-