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.protected List<com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.ContainerEntry>getContainers(CloudPlayer source)booleanisValid(CloudPlayer player)Returns whether this action is currently valid.voidonAddToTransaction(InventoryTransaction transaction)Called when the action is added to the specified InventoryTransaction.Methods inherited from class org.cloudburstmc.server.inventory.transaction.action.ItemStackAction
getSourceInventory, getSourceItem, getSourceSlot, getTargetInventory, getTargetItem, getTargetSlot, onExecuteFail, onExecuteSuccessMethods 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
-
getContainers
protected List<com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.ContainerEntry> getContainers(CloudPlayer source)- Specified by:
getContainersin classItemStackAction
-