PocketMine-MP 5.42.1 git-d77520d210fcb967a02bc11817ad625393c8ebc6
Loading...
Searching...
No Matches
pocketmine\inventory\transaction\action\CreateItemAction Class Reference
+ Inheritance diagram for pocketmine\inventory\transaction\action\CreateItemAction:
+ Collaboration diagram for pocketmine\inventory\transaction\action\CreateItemAction:

Public Member Functions

 __construct (Item $sourceItem)
 
 execute (Player $source)
 
 getSourceItem ()
 
 getTargetItem ()
 
 onAddToTransaction (InventoryTransaction $transaction)
 
 onPreExecute (Player $source)
 
 validate (Player $source)
 

Detailed Description

This action is used by creative players to balance transactions involving the creative inventory menu. The source item is the item being created ("taken" from the creative menu).

Definition at line 35 of file CreateItemAction.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\inventory\transaction\action\CreateItemAction::__construct ( Item $sourceItem)

Definition at line 37 of file CreateItemAction.php.

Member Function Documentation

◆ execute()

pocketmine\inventory\transaction\action\CreateItemAction::execute ( Player $source)

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 from pocketmine\inventory\transaction\action\InventoryAction.

Definition at line 50 of file CreateItemAction.php.

◆ getSourceItem()

pocketmine\inventory\transaction\action\InventoryAction::getSourceItem ( )
inherited

Returns the item that was present before the action took place.

Definition at line 43 of file InventoryAction.php.

◆ getTargetItem()

pocketmine\inventory\transaction\action\InventoryAction::getTargetItem ( )
inherited

Returns the item that the action attempted to replace the source item with.

Definition at line 50 of file InventoryAction.php.

◆ onAddToTransaction()

pocketmine\inventory\transaction\action\InventoryAction::onAddToTransaction ( InventoryTransaction $transaction)
inherited

Called when the action is added to the specified InventoryTransaction.

Deprecated

Definition at line 65 of file InventoryAction.php.

◆ onPreExecute()

pocketmine\inventory\transaction\action\InventoryAction::onPreExecute ( Player $source)
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.

◆ validate()

pocketmine\inventory\transaction\action\CreateItemAction::validate ( Player $source)

Returns whether this action is currently valid. This should perform any necessary sanity checks.

Exceptions
TransactionValidationException

Reimplemented from pocketmine\inventory\transaction\action\InventoryAction.

Definition at line 41 of file CreateItemAction.php.


The documentation for this class was generated from the following file: