Clean up SlotChangeAction inventory handling

This commit is contained in:
Dylan K. Taylor
2017-09-21 12:44:03 +01:00
parent 6aa9b081e9
commit d89b8cf12e
3 changed files with 36 additions and 7 deletions

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\inventory\transaction\action;
use pocketmine\inventory\transaction\InventoryTransaction;
use pocketmine\item\Item;
use pocketmine\Player;
@ -74,6 +75,15 @@ abstract class InventoryAction{
*/
abstract public function isValid(Player $source) : bool;
/**
* Called when the action is added to the specified InventoryTransaction.
*
* @param InventoryTransaction $transaction
*/
public function onAddToTransaction(InventoryTransaction $transaction) : void{
}
/**
* Called by inventory transactions before any actions are processed. If this returns false, the transaction will
* be cancelled.