Package simplexity.invisibleframes
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
ConstructorDescriptionFrameToggleEvent
(org.bukkit.entity.ItemFrame itemFrame, org.bukkit.entity.Player player) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 isSet<org.bukkit.inventory.ItemStack>
Returns the blacklisted items from the configurationorg.bukkit.inventory.ItemStack
Returns the item contained in the item framestatic org.bukkit.event.HandlerList
Gets the HandlerList for this event@NotNull org.bukkit.event.HandlerList
Gets the HandlerList for this eventorg.bukkit.entity.ItemFrame
Gets the item frame from this eventorg.bukkit.entity.Player
Gets the player from this eventboolean
Checks if this event has been cancelledboolean
Returns whether the item frame is currently fixedboolean
Returns whether the item frame is currently visibleboolean
Returns whether the item frame is holding a custom itemsAdder itemvoid
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 cancelledvoid
Sets item frame visible/invisible
Sets item frame fixed/not fixed if the configuration allows for fixing framesMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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
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 interfaceorg.bukkit.event.Cancellable
- Returns:
- boolean
-
setCancelled
public void setCancelled(boolean cancel) Sets whether this event should be cancelled- Specified by:
setCancelled
in interfaceorg.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 classorg.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
-