Class TakeItemStackAction
java.lang.Object
org.cloudburstmc.server.inventory.transaction.action.InventoryAction
org.cloudburstmc.server.inventory.transaction.action.ItemStackAction
org.cloudburstmc.server.inventory.transaction.action.TakeItemStackAction
-
Field Summary
Fields inherited from class org.cloudburstmc.server.inventory.transaction.action.InventoryAction
sourceItem, targetItem -
Constructor Summary
ConstructorsConstructorDescriptionTakeItemStackAction(int id, int count, com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData source, com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData target) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(CloudPlayer source)Performs actions needed to complete the inventory-action server-side.Returns the item that was present before the action took place.booleanisValid(CloudPlayer source)Returns whether this action is currently valid.Methods inherited from class org.cloudburstmc.server.inventory.transaction.action.ItemStackAction
getSourceSlot, getTargetItem, getTargetSlot, onAddToTransaction, onExecuteFail, onExecuteSuccessMethods inherited from class org.cloudburstmc.server.inventory.transaction.action.InventoryAction
getCreationTime, onPreExecute
-
Constructor Details
-
TakeItemStackAction
public TakeItemStackAction(int id, int count, com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData source, com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData target)
-
-
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:
source- 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:
source- player- Returns:
- successfully executed
-
getSourceItem
Description copied from class:InventoryActionReturns the item that was present before the action took place.- Overrides:
getSourceItemin classItemStackAction- Returns:
- source item
-