Class GrindstoneItemAction
java.lang.Object
cn.nukkit.inventory.transaction.action.InventoryAction
cn.nukkit.inventory.transaction.action.GrindstoneItemAction
- Since:
- 2021-03-21
- Author:
- joserobjr
-
Field Summary
Fields inherited from class cn.nukkit.inventory.transaction.action.InventoryAction
sourceItem, targetItem
-
Constructor Summary
ConstructorDescriptionGrindstoneItemAction
(Item sourceItem, Item targetItem, int type, int experience) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Performs actions needed to complete the inventory-action server-side.int
int
getType()
boolean
Returns whether this action is currently valid.void
onExecuteFail
(Player source) Performs additional actions when this inventory-action did not complete successfully.void
onExecuteSuccess
(Player source) Performs additional actions when this inventory-action completed successfully.Methods inherited from class cn.nukkit.inventory.transaction.action.InventoryAction
getCreationTime, getSourceItem, getTargetItem, onAddToTransaction, onPreExecute, toString
-
Constructor Details
-
GrindstoneItemAction
@PowerNukkitOnly @Since("1.4.0.0-PN") public GrindstoneItemAction(Item sourceItem, Item targetItem, int type, int experience)
-
-
Method Details
-
isValid
Description copied from class:InventoryAction
Returns whether this action is currently valid. This should perform any necessary sanity checks.- Specified by:
isValid
in classInventoryAction
- Parameters:
source
- player- Returns:
- valid
-
execute
Description copied from class:InventoryAction
Performs 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:
execute
in classInventoryAction
- Parameters:
source
- player- Returns:
- successfully executed
-
onExecuteSuccess
Description copied from class:InventoryAction
Performs additional actions when this inventory-action completed successfully.- Specified by:
onExecuteSuccess
in classInventoryAction
- Parameters:
source
- player
-
onExecuteFail
Description copied from class:InventoryAction
Performs additional actions when this inventory-action did not complete successfully.- Specified by:
onExecuteFail
in classInventoryAction
- Parameters:
source
- player
-
getExperience
-
getType
-