Class ChestSortEvent

java.lang.Object
org.bukkit.event.Event
me.ulrich.clans.events.ChestSortEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class ChestSortEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChestSortEvent(org.bukkit.inventory.Inventory inv)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.event.HandlerList
     
    org.bukkit.event.HandlerList
     
    org.bukkit.inventory.Inventory
    Returns the inventory associated with this event
    org.bukkit.Location
    Returns the location associated with this event.
    org.bukkit.entity.HumanEntity
    Returns the player associated with this event.
    Map<org.bukkit.inventory.ItemStack,Map<String,String>>
     
    List<org.bukkit.inventory.ItemStack>
     
     
    boolean
    Checks whether this event is cancelled.
    boolean
    isUnmovable(int slot)
    Checks whether a slot number is set as unmovable
    boolean
    isUnmovable(org.bukkit.inventory.ItemStack itemStack)
    Checks whether an ItemStack is set as unmovable
    void
    removeUnmovable(int slot)
    Removes a slot number from the list of unmovable slots
    void
    removeUnmovable(org.bukkit.inventory.ItemStack itemStack)
    Removes an ItemStack from the list of unmovable ItemStacks
    void
    setCancelled(boolean cancel)
     
    void
    setLocation(org.bukkit.Location loc)
    Sets the location associated with this event
    void
    setPlayer(org.bukkit.entity.HumanEntity p)
    Sets the player associated with this event
    void
    setSortableMaps(Map<org.bukkit.inventory.ItemStack,Map<String,String>> sortableMap)
     
    void
    setUnmovable(int slot)
    Prevents ChestSort from sorting/moving this specific slot
    void
    setUnmovable(org.bukkit.inventory.ItemStack itemStack)
    Prevents ChestSort from sorting/moving matching ItemStacks

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChestSortEvent

      public ChestSortEvent(org.bukkit.inventory.Inventory inv)
  • Method Details

    • getUnmovableItemStacks

      public List<org.bukkit.inventory.ItemStack> getUnmovableItemStacks()
    • getUnmovableSlots

      public List<Integer> getUnmovableSlots()
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
    • getLocation

      public org.bukkit.Location getLocation()
      Returns the location associated with this event. Might be null
      Returns:
      Location associated with this event, or null if no location has been set
    • setLocation

      public void setLocation(org.bukkit.Location loc)
      Sets the location associated with this event
      Parameters:
      loc -
    • getInventory

      public org.bukkit.inventory.Inventory getInventory()
      Returns the inventory associated with this event
      Returns:
      Inventory to be sorted
    • getSortableMaps

      public Map<org.bukkit.inventory.ItemStack,Map<String,String>> getSortableMaps()
    • setSortableMaps

      public void setSortableMaps(Map<org.bukkit.inventory.ItemStack,Map<String,String>> sortableMap)
    • getPlayer

      public org.bukkit.entity.HumanEntity getPlayer()
      Returns the player associated with this event. Might be null
      Returns:
      Player associated with this event, or null if no player has been set
    • setPlayer

      public void setPlayer(org.bukkit.entity.HumanEntity p)
      Sets the player associated with this event
      Parameters:
      p - Player associated with this event, can be null
    • setUnmovable

      public void setUnmovable(int slot)
      Prevents ChestSort from sorting/moving this specific slot
      Parameters:
      slot -
    • setUnmovable

      public void setUnmovable(org.bukkit.inventory.ItemStack itemStack)
      Prevents ChestSort from sorting/moving matching ItemStacks
      Parameters:
      itemStack -
    • removeUnmovable

      public void removeUnmovable(int slot)
      Removes a slot number from the list of unmovable slots
      Parameters:
      slot -
    • removeUnmovable

      public void removeUnmovable(org.bukkit.inventory.ItemStack itemStack)
      Removes an ItemStack from the list of unmovable ItemStacks
      Parameters:
      itemStack -
    • isUnmovable

      public boolean isUnmovable(int slot)
      Checks whether a slot number is set as unmovable
      Parameters:
      slot -
      Returns:
      true if the slot number has been set unmovable, otherwise false
    • isUnmovable

      public boolean isUnmovable(org.bukkit.inventory.ItemStack itemStack)
      Checks whether an ItemStack is set as unmovable
      Parameters:
      itemStack -
      Returns:
      true if the ItemStack has been set unmovable, otherwise false
    • getHandlers

      public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • isCancelled

      public boolean isCancelled()
      Checks whether this event is cancelled. If true, the Inventory will not be sorted
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      true when the event has been cancelled, otherwise false
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable