PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
|
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 89 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.
pocketmine\inventory\transaction\action\SlotChangeAction::onAddToTransaction | ( | InventoryTransaction | $transaction | ) |
Adds this action's target inventory to the transaction's inventory list.
Reimplemented from pocketmine\inventory\transaction\action\InventoryAction.
Definition at line 82 of file SlotChangeAction.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 72 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.