PocketMine-MP 5.24.1 git-39e69276a1bbe86ebd583e834381e5bc73948564
|
Public Member Functions | |
__construct (protected Item $sourceItem, protected Item $targetItem) | |
execute (Player $source) | |
getSourceItem () | |
getTargetItem () | |
onAddToTransaction (InventoryTransaction $transaction) | |
onPreExecute (Player $source) | |
validate (Player $source) | |
Represents an action involving a change that applies in some way to an inventory or other item-source.
Definition at line 34 of file InventoryAction.php.
pocketmine\inventory\transaction\action\InventoryAction::__construct | ( | protected Item | $sourceItem, |
protected Item | $targetItem ) |
Definition at line 35 of file InventoryAction.php.
|
abstract |
Performs actions needed to complete the inventory-action server-side. This will only be called if the transaction which it is part of is considered valid.
Reimplemented in pocketmine\inventory\transaction\action\CreateItemAction, pocketmine\inventory\transaction\action\DestroyItemAction, pocketmine\inventory\transaction\action\DropItemAction, and pocketmine\inventory\transaction\action\SlotChangeAction.
pocketmine\inventory\transaction\action\InventoryAction::getSourceItem | ( | ) |
Returns the item that was present before the action took place.
Definition at line 43 of file InventoryAction.php.
pocketmine\inventory\transaction\action\InventoryAction::getTargetItem | ( | ) |
Returns the item that the action attempted to replace the source item with.
Definition at line 50 of file InventoryAction.php.
pocketmine\inventory\transaction\action\InventoryAction::onAddToTransaction | ( | InventoryTransaction | $transaction | ) |
Called when the action is added to the specified InventoryTransaction.
Definition at line 65 of file InventoryAction.php.
pocketmine\inventory\transaction\action\InventoryAction::onPreExecute | ( | Player | $source | ) |
Called by inventory transactions before any actions are processed. If this returns false, the transaction will be cancelled.
Reimplemented in pocketmine\inventory\transaction\action\DropItemAction.
Definition at line 73 of file InventoryAction.php.
|
abstract |
Returns whether this action is currently valid. This should perform any necessary sanity checks.
TransactionValidationException |
Reimplemented in pocketmine\inventory\transaction\action\CreateItemAction, pocketmine\inventory\transaction\action\DestroyItemAction, pocketmine\inventory\transaction\action\DropItemAction, and pocketmine\inventory\transaction\action\SlotChangeAction.