Class DropItemAction
java.lang.Object
org.cloudburstmc.server.inventory.transaction.action.InventoryAction
org.cloudburstmc.server.inventory.transaction.action.DropItemAction
- Author:
- CreeperFace
-
Field Summary
Fields inherited from class org.cloudburstmc.server.inventory.transaction.action.InventoryAction
sourceItem, targetItem -
Constructor Summary
ConstructorsConstructorDescriptionDropItemAction(org.cloudburstmc.api.item.ItemStack source, org.cloudburstmc.api.item.ItemStack target) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(CloudPlayer source)Drops the target item in front of the player.booleanisValid(CloudPlayer source)Verifies that the source item of a drop-item action must be air.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.booleanonPreExecute(CloudPlayer source)Called by inventory transactions before any actions are processed.Methods inherited from class org.cloudburstmc.server.inventory.transaction.action.InventoryAction
getCreationTime, getSourceItem, getTargetItem, onAddToTransaction
-
Constructor Details
-
DropItemAction
public DropItemAction(org.cloudburstmc.api.item.ItemStack source, org.cloudburstmc.api.item.ItemStack target)
-
-
Method Details
-
isValid
Verifies that the source item of a drop-item action must be air. This is not strictly necessary, just a sanity check.- Specified by:
isValidin classInventoryAction- Parameters:
source- player- Returns:
- valid
-
onPreExecute
Description copied from class:InventoryActionCalled by inventory transactions before any actions are processed. If this returns false, the transaction will be cancelled.- Overrides:
onPreExecutein classInventoryAction- Parameters:
source- player- Returns:
- cancelled
-
execute
Drops the target item in front of the player.- Specified by:
executein classInventoryAction- Parameters:
source- player- 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
-