Class MoveItemStackAction


public class MoveItemStackAction extends ItemStackAction
  • Constructor Details

    • MoveItemStackAction

      public MoveItemStackAction(int id, int count, com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData source, com.nukkitx.protocol.bedrock.data.inventory.StackRequestSlotInfoData target)
  • Method Details

    • isValid

      public boolean isValid(CloudPlayer player)
      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:
      player - player
      Returns:
      valid
    • execute

      public boolean execute(CloudPlayer player)
      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:
      player - player
      Returns:
      successfully executed
    • getSourceItem

      public CloudItemStack getSourceItem()
      Description copied from class: InventoryAction
      Returns the item that was present before the action took place.
      Overrides:
      getSourceItem in class ItemStackAction
      Returns:
      source item
    • getContainers

      protected List<com.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket.ContainerEntry> getContainers(CloudPlayer player)
      Specified by:
      getContainers in class ItemStackAction