Class CraftingTakeResultAction

java.lang.Object
cn.nukkit.inventory.transaction.action.InventoryAction
cn.nukkit.inventory.transaction.action.CraftingTakeResultAction
Direct Known Subclasses:
CraftingTakeResultExperienceAction

public class CraftingTakeResultAction extends InventoryAction
Author:
CreeperFace
  • Constructor Details

    • CraftingTakeResultAction

      public CraftingTakeResultAction(Item sourceItem, Item targetItem)
  • Method Details

    • onAddToTransaction

      public void onAddToTransaction(InventoryTransaction transaction)
      Description copied from class: InventoryAction
      Called when the action is added to the specified InventoryTransaction.
      Overrides:
      onAddToTransaction in class InventoryAction
      Parameters:
      transaction - to add
    • isValid

      public boolean isValid(Player source)
      Description copied from class: InventoryAction
      Returns whether this action is currently valid. This should perform any necessary sanity checks.
      Specified by:
      isValid in class InventoryAction
      Parameters:
      source - player
      Returns:
      valid
    • execute

      public boolean execute(Player source)
      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 class InventoryAction
      Parameters:
      source - player
      Returns:
      successfully executed
    • onExecuteSuccess

      public void onExecuteSuccess(Player $source)
      Description copied from class: InventoryAction
      Performs additional actions when this inventory-action completed successfully.
      Specified by:
      onExecuteSuccess in class InventoryAction
      Parameters:
      $source - player
    • onExecuteFail

      public void onExecuteFail(Player source)
      Description copied from class: InventoryAction
      Performs additional actions when this inventory-action did not complete successfully.
      Specified by:
      onExecuteFail in class InventoryAction
      Parameters:
      source - player
    • toString

      public String toString()
      Overrides:
      toString in class InventoryAction