Package cn.nukkit.inventory.transaction
Class InventoryTransaction
java.lang.Object
cn.nukkit.inventory.transaction.InventoryTransaction
- Direct Known Subclasses:
CraftingTransaction
,EnchantTransaction
,GrindstoneTransaction
,RepairItemTransaction
,SmithingTransaction
,TradingTransaction
- Author:
- CreeperFace
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<InventoryAction>
protected boolean
protected Player
-
Constructor Summary
ConstructorDescriptionInventoryTransaction
(Player source, List<InventoryAction> actions) InventoryTransaction
(Player source, List<InventoryAction> actions, boolean init) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAction
(InventoryAction action) void
addInventory
(Inventory inventory) This method should not be used by plugins, it's used to add tracked inventories for InventoryActions involving inventories.protected boolean
boolean
boolean
execute()
long
boolean
protected void
init
(Player source, List<InventoryAction> actions) protected boolean
matchItems
(List<Item> needItems, List<Item> haveItems) protected void
-
Field Details
-
hasExecuted
protected boolean hasExecuted -
source
-
inventories
-
actions
-
-
Constructor Details
-
InventoryTransaction
-
InventoryTransaction
-
-
Method Details
-
init
-
getSource
-
getCreationTime
public long getCreationTime() -
getInventories
-
getActionList
-
getActions
-
addAction
-
addInventory
This method should not be used by plugins, it's used to add tracked inventories for InventoryActions involving inventories.- Parameters:
inventory
- to add
-
matchItems
-
sendInventories
protected void sendInventories() -
canExecute
public boolean canExecute() -
callExecuteEvent
protected boolean callExecuteEvent() -
execute
@PowerNukkitDifference(since="1.4.0.0-PN", info="Always returns false if the execution is not possible") public boolean execute() -
hasExecuted
public boolean hasExecuted()
-