Class CraftRecipeAction
java.lang.Object
org.cloudburstmc.server.inventory.transaction.action.InventoryAction
org.cloudburstmc.server.inventory.transaction.action.ItemStackAction
org.cloudburstmc.server.inventory.transaction.action.CraftRecipeAction
-
Field Summary
Fields inherited from class org.cloudburstmc.server.inventory.transaction.action.InventoryAction
sourceItem, targetItem -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(CloudPlayer player)Performs actions needed to complete the inventory-action server-side.booleanisValid(CloudPlayer player)Returns whether this action is currently valid.voidonAddToTransaction(InventoryTransaction transaction)Called when the action is added to the specified InventoryTransaction.voidonExecuteSuccess(CloudPlayer source)Performs additional actions when this inventory-action completed successfully.Methods inherited from class org.cloudburstmc.server.inventory.transaction.action.ItemStackAction
getSourceItem, getSourceSlot, getTargetItem, getTargetSlot, onExecuteFailMethods inherited from class org.cloudburstmc.server.inventory.transaction.action.InventoryAction
getCreationTime, onPreExecute
-
Constructor Details
-
CraftRecipeAction
public CraftRecipeAction(int reqId, int recipeId)
-
-
Method Details
-
isValid
Description copied from class:InventoryActionReturns whether this action is currently valid. This should perform any necessary sanity checks.- Specified by:
isValidin classInventoryAction- Parameters:
player- player- Returns:
- valid
-
execute
Description copied from class:InventoryActionPerforms actions needed to complete the inventory-action server-side. Returns if it was successful. Will return false if plugins cancelled events. This will only be called if the transaction which it is part of is considered valid.- Specified by:
executein classInventoryAction- Parameters:
player- player- Returns:
- successfully executed
-
onAddToTransaction
Description copied from class:InventoryActionCalled when the action is added to the specified InventoryTransaction.- Overrides:
onAddToTransactionin classItemStackAction- Parameters:
transaction- to add
-
onExecuteSuccess
Description copied from class:InventoryActionPerforms additional actions when this inventory-action completed successfully.- Overrides:
onExecuteSuccessin classItemStackAction- Parameters:
source- player
-