Class PlayerBlockUnlockEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
wtf.choco.locksecurity.api.event.block.PlayerBlockUnlockEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class PlayerBlockUnlockEvent
extends org.bukkit.event.player.PlayerEvent
implements org.bukkit.event.Cancellable
Called when a player unlocks a block.
- Since:
- 3.0.0
- Author:
- Parker Hawke - Choco
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description PlayerBlockUnlockEvent(ILockSecurityPlayer player, ILockedBlock lockedBlock, org.bukkit.inventory.ItemStack key, org.bukkit.inventory.EquipmentSlot hand, boolean request)
-
Method Summary
Modifier and Type Method Description org.bukkit.inventory.EquipmentSlot
getHand()
Get the hand used in this event.static org.bukkit.event.HandlerList
getHandlerList()
org.bukkit.event.HandlerList
getHandlers()
org.bukkit.inventory.ItemStack
getKey()
Get the unsmithed key used to unlock the block.ILockedBlock
getLockedBlock()
Get theILockedBlock
involved in this event.ILockSecurityPlayer
getPlayerWrapper()
Get theILockSecurityPlayer
wrapper for the player involved in this event.boolean
isCancelled()
boolean
isRequest()
Check whether or not the player is only requesting to unlock the block.void
setCancelled(boolean cancel)
-
Constructor Details
-
PlayerBlockUnlockEvent
public PlayerBlockUnlockEvent(@NotNull ILockSecurityPlayer player, @NotNull ILockedBlock lockedBlock, @NotNull org.bukkit.inventory.ItemStack key, @NotNull org.bukkit.inventory.EquipmentSlot hand, boolean request)
-
-
Method Details
-
getPlayerWrapper
Get theILockSecurityPlayer
wrapper for the player involved in this event.- Returns:
- the player wrapper
-
getLockedBlock
Get theILockedBlock
involved in this event.- Returns:
- the locked block
-
getKey
@NotNull public org.bukkit.inventory.ItemStack getKey()Get the unsmithed key used to unlock the block. Changes made to this item will not be reflected in the player's inventory.- Returns:
- the unsmithed key
-
getHand
@NotNull public org.bukkit.inventory.EquipmentSlot getHand()Get the hand used in this event.- Returns:
- the hand
-
isRequest
public boolean isRequest()Check whether or not the player is only requesting to unlock the block. If a request is being made, the block will not be unlocked after this event has succeeded... another event will be called at a later time confirming the unlock.- Returns:
- true if a request, false otherwise
-
setCancelled
public void setCancelled(boolean cancel)- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getHandlerList
@NotNull public static org.bukkit.event.HandlerList getHandlerList()
-