|
PocketMine-MP 5.41.1 git-dec84fe67dc3319e33f5066e5d03b16f00f2ff4c
|
Inheritance diagram for pocketmine\inventory\transaction\action\SlotChangeAction:
Collaboration diagram for pocketmine\inventory\transaction\action\SlotChangeAction:Public Member Functions | |
| __construct (protected Inventory $inventory, private int $inventorySlot, Item $sourceItem, Item $targetItem) | |
| execute (Player $source) | |
| getInventory () | |
| getSlot () | |
| getSourceItem () | |
| getTargetItem () | |
| onAddToTransaction (InventoryTransaction $transaction) | |
| onPreExecute (Player $source) | |
| validate (Player $source) | |
Represents an action causing a change in an inventory slot.
Definition at line 35 of file SlotChangeAction.php.
| pocketmine\inventory\transaction\action\SlotChangeAction::__construct | ( | protected Inventory | $inventory, |
| private int | $inventorySlot, | ||
| Item | $sourceItem, | ||
| Item | $targetItem ) |
Definition at line 36 of file SlotChangeAction.php.
| pocketmine\inventory\transaction\action\SlotChangeAction::execute | ( | Player | $source | ) |
Sets the item into the target inventory.
Reimplemented from pocketmine\inventory\transaction\action\InventoryAction.
Definition at line 90 of file SlotChangeAction.php.
| pocketmine\inventory\transaction\action\SlotChangeAction::getInventory | ( | ) |
Returns the inventory involved in this action.
Definition at line 48 of file SlotChangeAction.php.
| pocketmine\inventory\transaction\action\SlotChangeAction::getSlot | ( | ) |
Returns the slot in the inventory which this action modified.
Definition at line 55 of file SlotChangeAction.php.
|
inherited |
Returns the item that was present before the action took place.
Definition at line 43 of file InventoryAction.php.
|
inherited |
Returns the item that the action attempted to replace the source item with.
Definition at line 50 of file InventoryAction.php.
|
inherited |
Called when the action is added to the specified InventoryTransaction.
Definition at line 65 of file InventoryAction.php.
|
inherited |
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.
| pocketmine\inventory\transaction\action\SlotChangeAction::validate | ( | Player | $source | ) |
Checks if the item in the inventory at the specified slot is the same as this action's source item.
| TransactionValidationException |
Reimplemented from pocketmine\inventory\transaction\action\InventoryAction.
Definition at line 64 of file SlotChangeAction.php.