public abstract class InventoryAction extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Item |
sourceItem |
protected Item |
targetItem |
| Constructor and Description |
|---|
InventoryAction(Item sourceItem,
Item targetItem) |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
execute(Player source)
Performs actions needed to complete the inventory-action server-side.
|
long |
getCreationTime() |
Item |
getSourceItem()
Returns the item that was present before the action took place.
|
Item |
getTargetItem()
Returns the item that the action attempted to replace the source item with.
|
abstract boolean |
isValid(Player source)
Returns whether this action is currently valid.
|
void |
onAddToTransaction(InventoryTransaction transaction)
Called when the action is added to the specified InventoryTransaction.
|
abstract void |
onExecuteFail(Player source)
Performs additional actions when this inventory-action did not complete successfully.
|
abstract void |
onExecuteSuccess(Player source)
Performs additional actions when this inventory-action completed successfully.
|
boolean |
onPreExecute(Player source)
Called by inventory transactions before any actions are processed.
|
public long getCreationTime()
public Item getSourceItem()
public Item getTargetItem()
public boolean onPreExecute(Player source)
source - playerpublic abstract boolean isValid(Player source)
source - playerpublic void onAddToTransaction(InventoryTransaction transaction)
transaction - to addpublic abstract boolean execute(Player source)
source - playerpublic abstract void onExecuteSuccess(Player source)
source - playerpublic abstract void onExecuteFail(Player source)
source - playerCopyright © 2020. All rights reserved.