Class FrameToggleEvent

java.lang.Object
org.bukkit.event.Event
simplexity.invisibleframes.FrameToggleEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class FrameToggleEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
Run when an item frame is toggled from visible to invisible or vice-versa
  • Nested Class Summary

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

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

    Constructors
    Constructor
    Description
    FrameToggleEvent(org.bukkit.entity.ItemFrame itemFrame, org.bukkit.entity.Player player)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Checks the contained item against the configured item blacklist.
    void
    Checks if the item is a custom item from itemsadder.
    void
    Checks if the item frame is empty, cancels the event if it is
    Set<org.bukkit.inventory.ItemStack>
    Returns the blacklisted items from the configuration
    org.bukkit.inventory.ItemStack
    Returns the item contained in the item frame
    static org.bukkit.event.HandlerList
    Gets the HandlerList for this event
    @NotNull org.bukkit.event.HandlerList
    Gets the HandlerList for this event
    org.bukkit.entity.ItemFrame
    Gets the item frame from this event
    org.bukkit.entity.Player
    Gets the player from this event
    boolean
    Checks if this event has been cancelled
    boolean
    Returns whether the item frame is currently fixed
    boolean
    Returns whether the item frame is currently visible
    boolean
    Returns whether the item frame is holding a custom itemsAdder item
    void
    Runs all checks that determine if the event should be cancelled: checkItemsAdder(), checkBlacklist(), and checkToggleEmpty()
    void
    setCancelled(boolean cancel)
    Sets whether this event should be cancelled
    void
    Sets item frame visible/invisible
    Sets item frame fixed/not fixed if the configuration allows for fixing frames

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

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

    • FrameToggleEvent

      public FrameToggleEvent(org.bukkit.entity.ItemFrame itemFrame, org.bukkit.entity.Player player)
  • Method Details

    • isFrameFixed

      public boolean isFrameFixed()
      Returns whether the item frame is currently fixed
      Returns:
      boolean
    • isFrameVisible

      public boolean isFrameVisible()
      Returns whether the item frame is currently visible
      Returns:
      boolean
    • isItemsAdderCustomStack

      public boolean isItemsAdderCustomStack()
      Returns whether the item frame is holding a custom itemsAdder item
      Returns:
      boolean
    • getBlacklistedItems

      public Set<org.bukkit.inventory.ItemStack> getBlacklistedItems()
      Returns the blacklisted items from the configuration
      Returns:
      Set
    • getContainedItem

      public org.bukkit.inventory.ItemStack getContainedItem()
      Returns the item contained in the item frame
      Returns:
      ItemStack
    • checkToggleEmpty

      public void checkToggleEmpty()
      Checks if the item frame is empty, cancels the event if it is
    • toggleFrame

      public void toggleFrame()
      Sets item frame visible/invisible
      Sets item frame fixed/not fixed if the configuration allows for fixing frames
    • runAllChecks

      public void runAllChecks()
      Runs all checks that determine if the event should be cancelled: checkItemsAdder(), checkBlacklist(), and checkToggleEmpty()
    • checkBlacklist

      public void checkBlacklist()
      Checks the contained item against the configured item blacklist. Cancels the event if the item is blacklisted
    • checkItemsAdder

      public void checkItemsAdder()
      Checks if the item is a custom item from itemsadder. Cancels the event if it is.
    • isCancelled

      public boolean isCancelled()
      Checks if this event has been cancelled
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      boolean
    • setCancelled

      public void setCancelled(boolean cancel)
      Sets whether this event should be cancelled
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - boolean
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the HandlerList for this event
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      HandlerList
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Gets the HandlerList for this event
      Returns:
      HandlerList
    • getItemFrame

      public org.bukkit.entity.ItemFrame getItemFrame()
      Gets the item frame from this event
      Returns:
      ItemFrame
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Gets the player from this event
      Returns:
      Player