public class CreativeInventoryAction extends InventoryAction
| Modifier and Type | Field and Description |
|---|---|
protected int |
actionType |
static int |
TYPE_CREATE_ITEM
Player took an item from the creative window.
|
static int |
TYPE_DELETE_ITEM
Player put an item into the creative window to destroy it.
|
sourceItem, targetItem| Constructor and Description |
|---|
CreativeInventoryAction(Item source,
Item target,
int action) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(Player source)
No need to do anything extra here: this type just provides a place for items to disappear or appear from.
|
int |
getActionType()
Returns the type of the action.
|
boolean |
isValid(Player source)
Checks that the player is in creative, and (if creating an item) that the item exists in the creative inventory.
|
void |
onExecuteFail(Player source)
Performs additional actions when this inventory-action did not complete successfully.
|
void |
onExecuteSuccess(Player source)
Performs additional actions when this inventory-action completed successfully.
|
getCreationTime, getSourceItem, getTargetItem, onAddToTransaction, onPreExecutepublic static final int TYPE_DELETE_ITEM
public static final int TYPE_CREATE_ITEM
protected int actionType
public boolean isValid(Player source)
isValid in class InventoryActionsource - playerpublic int getActionType()
public boolean execute(Player source)
execute in class InventoryActionsource - playerepublic void onExecuteSuccess(Player source)
InventoryActiononExecuteSuccess in class InventoryActionsource - playerpublic void onExecuteFail(Player source)
InventoryActiononExecuteFail in class InventoryActionsource - playerCopyright © 2020. All rights reserved.