Package me.ulrich.clans.events
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerListorg.bukkit.event.HandlerListorg.bukkit.inventory.InventoryReturns the inventory associated with this eventorg.bukkit.LocationReturns the location associated with this event.org.bukkit.entity.HumanEntityReturns the player associated with this event.List<org.bukkit.inventory.ItemStack>booleanChecks whether this event is cancelled.booleanisUnmovable(int slot) Checks whether a slot number is set as unmovablebooleanisUnmovable(org.bukkit.inventory.ItemStack itemStack) Checks whether an ItemStack is set as unmovablevoidremoveUnmovable(int slot) Removes a slot number from the list of unmovable slotsvoidremoveUnmovable(org.bukkit.inventory.ItemStack itemStack) Removes an ItemStack from the list of unmovable ItemStacksvoidsetCancelled(boolean cancel) voidsetLocation(org.bukkit.Location loc) Sets the location associated with this eventvoidsetPlayer(org.bukkit.entity.HumanEntity p) Sets the player associated with this eventvoidsetSortableMaps(Map<org.bukkit.inventory.ItemStack, Map<String, String>> sortableMap) voidsetUnmovable(int slot) Prevents ChestSort from sorting/moving this specific slotvoidsetUnmovable(org.bukkit.inventory.ItemStack itemStack) Prevents ChestSort from sorting/moving matching ItemStacksMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
ChestSortEvent
public ChestSortEvent(org.bukkit.inventory.Inventory inv)
-
-
Method Details
-
getUnmovableItemStacks
-
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
-
setSortableMaps
-
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:
getHandlersin classorg.bukkit.event.Event
-
isCancelled
public boolean isCancelled()Checks whether this event is cancelled. If true, the Inventory will not be sorted- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- true when the event has been cancelled, otherwise false
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-