PHP Class pocketmine\inventory\BaseTransaction

Inheritance: implements pocketmine\inventory\Transaction
Mostrar archivo Open project: iTXTech/Genisys Class Usage Examples

Protected Properties

Property Type Description
$achievements string
$creationTime float
$failures integer
$inventory pocketmine\inventory\Inventory
$slot integer
$targetItem pocketmine\item\Item
$transactionType integer
$wasSuccessful boolean

Public Methods

Method Description
__construct ( pocketmine\inventory\Inventory $inventory, integer $slot, Item $targetItem, string[] $achievements = [], integer $transactionType = Transaction::TYPE_NORMAL )
addAchievement ( string $achievementName )
addFailure ( )
execute ( Player $source ) : boolean
getAchievements ( )
getChange ( ) : Item[ Returns the change in inventory resulting from this transaction
getCreationTime ( )
getFailures ( )
getInventory ( )
getSlot ( )
getTargetItem ( )
getTransactionType ( )
hasAchievements ( )
sendSlotUpdate ( Player $source )
setSuccess ( $value = true )
setTargetItem ( Item $item )
succeeded ( )

Method Details

__construct() public method

public __construct ( pocketmine\inventory\Inventory $inventory, integer $slot, Item $targetItem, string[] $achievements = [], integer $transactionType = Transaction::TYPE_NORMAL )
$inventory pocketmine\inventory\Inventory
$slot integer
$targetItem pocketmine\item\Item
$achievements string[]
$transactionType integer

addAchievement() public method

public addAchievement ( string $achievementName )
$achievementName string

addFailure() public method

public addFailure ( )

execute() public method

public execute ( Player $source ) : boolean
$source pocketmine\Player
return boolean Handles transaction execution. Returns whether transaction was successful or not.

getAchievements() public method

public getAchievements ( )

getChange() public method

Returns the change in inventory resulting from this transaction
public getChange ( ) : Item[
return pocketmine\item\Item[

getCreationTime() public method

public getCreationTime ( )

getFailures() public method

public getFailures ( )

getInventory() public method

public getInventory ( )

getSlot() public method

public getSlot ( )

getTargetItem() public method

public getTargetItem ( )

getTransactionType() public method

public getTransactionType ( )

hasAchievements() public method

public hasAchievements ( )

sendSlotUpdate() public method

public sendSlotUpdate ( Player $source )
$source pocketmine\Player 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)

setSuccess() public method

public setSuccess ( $value = true )

setTargetItem() public method

public setTargetItem ( Item $item )
$item pocketmine\item\Item

succeeded() public method

public succeeded ( )

Property Details

$achievements protected_oe property

protected string $achievements
return string

$creationTime protected_oe property

protected float $creationTime
return float

$failures protected_oe property

protected int $failures
return integer

$inventory protected_oe property

protected Inventory,pocketmine\inventory $inventory
return pocketmine\inventory\Inventory

$slot protected_oe property

protected int $slot
return integer

$targetItem protected_oe property

protected Item,pocketmine\item $targetItem
return pocketmine\item\Item

$transactionType protected_oe property

protected int $transactionType
return integer

$wasSuccessful protected_oe property

protected bool $wasSuccessful
return boolean