|
| $inventory |
|
| $slot |
|
| $targetItem |
|
| $creationTime |
|
| $transactionType = Transaction::TYPE_NORMAL |
|
| $failures = 0 |
|
| $wasSuccessful = false |
|
| $achievements = [] |
|
|
const | TYPE_NORMAL = 0 |
|
const | TYPE_DROP_ITEM = 1 |
|
__construct |
( |
|
$inventory, |
|
|
|
$slot, |
|
|
Item |
$targetItem, |
|
|
|
$achievements = [] , |
|
|
|
$transactionType = Transaction::TYPE_NORMAL |
|
) |
| |
- Parameters
-
Inventory | $inventory | |
int | $slot | |
Item | $targetItem | |
| string[] | $achievements |
int | $transactionType | |
- Parameters
-
- Returns
- bool
Handles transaction execution. Returns whether transaction was successful or not.
Implements Transaction.
Returns the change in inventory resulting from this transaction
- Returns
- array ("in" => items added to the inventory, "out" => items removed from the inventory) ]
sendSlotUpdate |
( |
Player |
$source | ) |
|
- Parameters
-
Player | $source | Sends a slot update to inventory viewers For successful transactions, update non-source viewers (source does not need updating) For failed transactions, update the source (non-source viewers will see nothing anyway) |
The documentation for this class was generated from the following file:
- src/pocketmine/inventory/BaseTransaction.php