Class CreativeInventoryAction
java.lang.Object
org.cloudburstmc.server.inventory.transaction.action.InventoryAction
org.cloudburstmc.server.inventory.transaction.action.CreativeInventoryAction
- Author:
- CreeperFace
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intstatic intPlayer took an item from the creative window.static intPlayer put an item into the creative window to destroy it.Fields inherited from class org.cloudburstmc.server.inventory.transaction.action.InventoryAction
sourceItem, targetItem -
Constructor Summary
ConstructorsConstructorDescriptionCreativeInventoryAction(org.cloudburstmc.api.item.ItemStack source, org.cloudburstmc.api.item.ItemStack target, int action) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(CloudPlayer source)No need to do anything extra here: this type just provides a place for items to disappear or appear from.intReturns the type of the action.booleanisValid(CloudPlayer source)Checks that the player is in creative, and (if creating an item) that the item exists in the creative inventory.voidonExecuteFail(CloudPlayer source)Performs additional actions when this inventory-action did not complete successfully.voidonExecuteSuccess(CloudPlayer source)Performs additional actions when this inventory-action completed successfully.Methods inherited from class org.cloudburstmc.server.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:
- Constant Field Values
-
TYPE_CREATE_ITEM
public static final int TYPE_CREATE_ITEMPlayer took an item from the creative window.- See Also:
- Constant Field Values
-
actionType
protected int actionType
-
-
Constructor Details
-
CreativeInventoryAction
public CreativeInventoryAction(org.cloudburstmc.api.item.ItemStack source, org.cloudburstmc.api.item.ItemStack target, int action)
-
-
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:
isValidin 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:
executein classInventoryAction- Parameters:
source- playere- Returns:
- successfully executed
-
onExecuteSuccess
Description copied from class:InventoryActionPerforms additional actions when this inventory-action completed successfully.- Specified by:
onExecuteSuccessin classInventoryAction- Parameters:
source- player
-
onExecuteFail
Description copied from class:InventoryActionPerforms additional actions when this inventory-action did not complete successfully.- Specified by:
onExecuteFailin classInventoryAction- Parameters:
source- player
-