Definition at line 36 of file EnchantingTransaction.php.
◆ __construct()
pocketmine\inventory\transaction\EnchantingTransaction::__construct |
( |
Player | $source, |
|
|
private readonly EnchantingOption | $option, |
|
|
private readonly int | $cost ) |
◆ addAction()
pocketmine\inventory\transaction\InventoryTransaction::addAction |
( |
InventoryAction | $action | ) |
|
|
inherited |
◆ callExecuteEvent()
pocketmine\inventory\transaction\EnchantingTransaction::callExecuteEvent |
( |
| ) |
|
|
protected |
◆ execute()
pocketmine\inventory\transaction\EnchantingTransaction::execute |
( |
| ) |
|
◆ findResultItem()
pocketmine\inventory\transaction\InventoryTransaction::findResultItem |
( |
Item | $needOrigin, |
|
|
array | $possibleActions ) |
|
protectedinherited |
- Parameters
-
SlotChangeAction[] | $possibleActions | @phpstan-param array<int, SlotChangeAction> $possibleActions |
Definition at line 236 of file InventoryTransaction.php.
◆ getActions()
pocketmine\inventory\transaction\InventoryTransaction::getActions |
( |
| ) |
|
|
inherited |
Returns an unordered set of actions involved in this transaction.
WARNING: This system is explicitly designed NOT to care about ordering. Any order seen in this set has NO significance and should not be relied on.
- Returns
- InventoryAction[] @phpstan-return array<int, InventoryAction>
Definition at line 106 of file InventoryTransaction.php.
◆ getInventories()
pocketmine\inventory\transaction\InventoryTransaction::getInventories |
( |
| ) |
|
|
inherited |
◆ getSource()
pocketmine\inventory\transaction\InventoryTransaction::getSource |
( |
| ) |
|
|
inherited |
◆ hasExecuted()
pocketmine\inventory\transaction\InventoryTransaction::hasExecuted |
( |
| ) |
|
|
inherited |
◆ matchItems()
pocketmine\inventory\transaction\InventoryTransaction::matchItems |
( |
array & | $needItems, |
|
|
array & | $haveItems ) |
|
protectedinherited |
- Parameters
-
Item[] | $needItems | |
Item[] | $haveItems | @phpstan-param-out list<Item> $needItems @phpstan-param-out list<Item> $haveItems |
- Exceptions
-
TransactionValidationException | |
Definition at line 142 of file InventoryTransaction.php.
◆ squashDuplicateSlotChanges()
pocketmine\inventory\transaction\InventoryTransaction::squashDuplicateSlotChanges |
( |
| ) |
|
|
protectedinherited |
Iterates over SlotChangeActions in this transaction and compacts any which refer to the same slot in the same inventory so they can be correctly handled.
Under normal circumstances, the same slot would never be changed more than once in a single transaction. However, due to the way things like the crafting grid are "implemented" in MCPE 1.2 (a.k.a. hacked-in), we may get multiple slot changes referring to the same slot in a single transaction. These multiples are not even guaranteed to be in the correct order (slot splitting in the crafting grid for example, causes the actions to be sent in the wrong order), so this method also tries to chain them into order.
Definition at line 191 of file InventoryTransaction.php.
◆ validate()
pocketmine\inventory\transaction\EnchantingTransaction::validate |
( |
| ) |
|
◆ $actions
array pocketmine\inventory\transaction\InventoryTransaction::$actions = [] |
|
protectedinherited |
◆ $hasExecuted
bool pocketmine\inventory\transaction\InventoryTransaction::$hasExecuted = false |
|
protectedinherited |
◆ $inventories
array pocketmine\inventory\transaction\InventoryTransaction::$inventories = [] |
|
protectedinherited |
The documentation for this class was generated from the following file: