Class CreativeInventoryAction
java.lang.Object
cn.nukkit.inventory.transaction.action.InventoryAction
cn.nukkit.inventory.transaction.action.CreativeInventoryAction
- Author:
- CreeperFace
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
static final int
Player took an item from the creative window.static final int
Player put an item into the creative window to destroy it.Fields inherited from class cn.nukkit.inventory.transaction.action.InventoryAction
sourceItem, targetItem
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
No need to do anything extra here: this type just provides a place for items to disappear or appear from.int
Returns the type of the action.boolean
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.toString()
Methods inherited from class cn.nukkit.inventory.transaction.action.InventoryAction
getCreationTime, getSourceItem, getTargetItem, onAddToTransaction, onPreExecute
-
Field Details
-
TYPE_DELETE_ITEM
public static final int TYPE_DELETE_ITEMPlayer put an item into the creative window to destroy it.- See Also:
-
TYPE_CREATE_ITEM
public static final int TYPE_CREATE_ITEMPlayer took an item from the creative window.- See Also:
-
actionType
protected int actionType
-
-
Constructor Details
-
CreativeInventoryAction
-
-
Method Details
-
isValid
Checks that the player is in creative, and (if creating an item) that the item exists in the creative inventory.- Specified by:
isValid
in classInventoryAction
- Parameters:
source
- player- Returns:
- valid
-
getActionType
public int getActionType()Returns the type of the action.- Returns:
- action type
-
execute
No need to do anything extra here: this type just provides a place for items to disappear or appear from.- Specified by:
execute
in classInventoryAction
- Parameters:
source
- playere- Returns:
- successfully executed
-
onExecuteSuccess
Description copied from class:InventoryAction
Performs additional actions when this inventory-action completed successfully.- Specified by:
onExecuteSuccess
in classInventoryAction
- Parameters:
source
- player
-
onExecuteFail
Description copied from class:InventoryAction
Performs additional actions when this inventory-action did not complete successfully.- Specified by:
onExecuteFail
in classInventoryAction
- Parameters:
source
- player
-
toString
- Overrides:
toString
in classInventoryAction
-