Class ItemStackAction
java.lang.Object
org.cloudburstmc.server.inventory.transaction.action.InventoryAction
org.cloudburstmc.server.inventory.transaction.action.ItemStackAction
- Direct Known Subclasses:
DropItemStackAction,PlaceItemStackAction,SwapItemStackAction,TakeItemStackAction
-
Field Summary
Fields inherited from class org.cloudburstmc.server.inventory.transaction.action.InventoryAction
sourceItem, targetItem -
Constructor Summary
ConstructorsConstructorDescriptionItemStackAction(int reqId, com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData sourceData, @Nullable com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData targetData) -
Method Summary
Modifier and TypeMethodDescriptionReturns the item that was present before the action took place.intReturns the item that the action attempted to replace the source item with.intvoidonAddToTransaction(InventoryTransaction transaction)Called when the action is added to the specified InventoryTransaction.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
execute, getCreationTime, isValid, onPreExecute
-
Constructor Details
-
ItemStackAction
public ItemStackAction(int reqId, com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData sourceData, @Nullable com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData targetData)
-
-
Method Details
-
onAddToTransaction
Description copied from class:InventoryActionCalled when the action is added to the specified InventoryTransaction.- Overrides:
onAddToTransactionin classInventoryAction- Parameters:
transaction- to add
-
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
-
getSourceSlot
public int getSourceSlot() -
getTargetSlot
public int getTargetSlot() -
getSourceItem
Description copied from class:InventoryActionReturns the item that was present before the action took place.- Overrides:
getSourceItemin classInventoryAction- Returns:
- source item
-
getTargetItem
Description copied from class:InventoryActionReturns the item that the action attempted to replace the source item with.- Overrides:
getTargetItemin classInventoryAction- Returns:
- target item
-