Package net.okocraft.box.api.transaction
Interface StockHolderTransaction.Withdrawal
- Enclosing class:
StockHolderTransaction
public static interface StockHolderTransaction.Withdrawal
An interface to withdraw items from
StockHolder.-
Method Summary
Modifier and TypeMethodDescription@NotNull TransactionResulttoInventory(@NotNull Inventory inventory, StockEvent.Cause cause) Withdraws items toInventory.@NotNull TransactionResulttoTopInventory(@NotNull InventoryView view, StockEvent.Cause cause) Withdraws items toInventoryView.getTopInventory().
-
Method Details
-
toInventory
@NotNull @NotNull TransactionResult toInventory(@NotNull @NotNull Inventory inventory, @NotNull StockEvent.Cause cause) Withdraws items toInventory.- Parameters:
inventory- anInventoryto put items incause- aStockEvent.Causethat is passed toStockHolder.decrease(BoxItem, int, StockEvent.Cause)- Returns:
- a
TransactionResult - Throws:
NullPointerException- ifinventoryorcauseis null
-
toTopInventory
@NotNull @NotNull TransactionResult toTopInventory(@NotNull @NotNull InventoryView view, @NotNull StockEvent.Cause cause) Withdraws items toInventoryView.getTopInventory().This method calls
InventoryClickEvents before putting the item in.- Parameters:
view- anInventoryViewto put items incause- aStockEvent.Causethat is passed toStockHolder.decrease(BoxItem, int, StockEvent.Cause)- Returns:
- a
TransactionResult - Throws:
NullPointerException- ifvieworcauseis null
-