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(org.cloudburstmc.api.item.ItemStack source,
org.cloudburstmc.api.item.ItemStack target,
int action) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(CloudPlayer 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(CloudPlayer source)
Checks that the player is in creative, and (if creating an item) that the item exists in the creative inventory.
|
void |
onExecuteFail(CloudPlayer source)
Performs additional actions when this inventory-action did not complete successfully.
|
void |
onExecuteSuccess(CloudPlayer 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 CreativeInventoryAction(org.cloudburstmc.api.item.ItemStack source,
org.cloudburstmc.api.item.ItemStack target,
int action)
public boolean isValid(CloudPlayer source)
isValid in class InventoryActionsource - playerpublic int getActionType()
public boolean execute(CloudPlayer source)
execute in class InventoryActionsource - playerepublic void onExecuteSuccess(CloudPlayer source)
InventoryActiononExecuteSuccess in class InventoryActionsource - playerpublic void onExecuteFail(CloudPlayer source)
InventoryActiononExecuteFail in class InventoryActionsource - playerCopyright © 2021. All rights reserved.