Class CreativeInventoryAction

java.lang.Object
cn.nukkit.inventory.transaction.action.InventoryAction
cn.nukkit.inventory.transaction.action.CreativeInventoryAction

public class CreativeInventoryAction extends InventoryAction
Author:
CreeperFace
  • Field Details

    • TYPE_DELETE_ITEM

      public static final int TYPE_DELETE_ITEM
      Player put an item into the creative window to destroy it.
      See Also:
    • TYPE_CREATE_ITEM

      public static final int TYPE_CREATE_ITEM
      Player took an item from the creative window.
      See Also:
    • actionType

      protected int actionType
  • Constructor Details

    • CreativeInventoryAction

      public CreativeInventoryAction(Item source, Item target, int action)
  • Method Details

    • isValid

      public boolean isValid(Player source)
      Checks that the player is in creative, and (if creating an item) that the item exists in the creative inventory.
      Specified by:
      isValid in class InventoryAction
      Parameters:
      source - player
      Returns:
      valid
    • getActionType

      public int getActionType()
      Returns the type of the action.
      Returns:
      action type
    • execute

      public boolean execute(Player source)
      No need to do anything extra here: this type just provides a place for items to disappear or appear from.
      Specified by:
      execute in class InventoryAction
      Parameters:
      source - playere
      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