Package wtf.choco.locksecurity.api.block
Interface ILockedBlockManager
public interface ILockedBlockManager
Represents a manager to handle all
ILockedBlocks
on the server.- Since:
- 3.0.0
- Author:
- Parker Hawke - Choco
-
Method Summary
Modifier and Type Method Description ILockedBlock
getLockedBlock(org.bukkit.block.Block block)
Get theILockedBlock
at the givenBlock
if one is present.ILockedBlock
getLockedBlock(org.bukkit.Location location)
Get theILockedBlock
at the givenLocation
if one is present.ILockedBlock
getLockedBlock(org.bukkit.World world, int x, int y, int z)
Get theILockedBlock
at the given position if one is present.Collection<ILockedBlock>
getLockedBlocks()
Get an immutable collection of allILockedBlocks
on the server.Collection<ILockedBlock>
getLockedBlocks(org.bukkit.OfflinePlayer owner)
Get an immutable collection of allILockedBlocks
owned by the specified player.Collection<ILockedBlock>
getLockedBlocks(ILockSecurityPlayer owner)
Get an immutable collection of allILockedBlocks
owned by the specified player.boolean
isLocked(org.bukkit.block.Block block)
Check whether or not the provided block has been locked.boolean
isLocked(org.bukkit.Location location)
Check whether or not the block at the provided location has been locked.boolean
isLocked(org.bukkit.World world, int x, int y, int z)
Check whether or not the block at the provided position has been locked.ILockedMultiBlock
lock(org.bukkit.block.Block block, org.bukkit.block.Block secondaryBlock, ILockSecurityPlayer owner)
Lock the blocks at the given locations with the supplied data.ILockedMultiBlock
lock(org.bukkit.block.Block block, org.bukkit.block.Block secondaryBlock, ILockSecurityPlayer owner, String nickname)
Lock the blocks at the given locations with the supplied data.ILockedMultiBlock
lock(org.bukkit.block.Block block, org.bukkit.block.Block secondaryBlock, ILockSecurityPlayer owner, ZonedDateTime lockTime)
Lock the blocks at the given locations with the supplied data.ILockedMultiBlock
lock(org.bukkit.block.Block block, org.bukkit.block.Block secondaryBlock, ILockSecurityPlayer owner, ZonedDateTime lockTime, String nickname)
Lock the blocks at the given locations with the supplied data.ILockedBlock
lock(org.bukkit.block.Block block, ILockSecurityPlayer owner)
Lock the block at the given location with the supplied data.ILockedBlock
lock(org.bukkit.block.Block block, ILockSecurityPlayer owner, String nickname)
Lock the block at the given location with the supplied data.ILockedBlock
lock(org.bukkit.block.Block block, ILockSecurityPlayer owner, ZonedDateTime lockTime)
Lock the block at the given location with the supplied data.ILockedBlock
lock(org.bukkit.block.Block block, ILockSecurityPlayer owner, ZonedDateTime lockTime, String nickname)
Lock the block at the given location with the supplied data.boolean
unlock(org.bukkit.block.Block block)
Unlock the block at the given location.
-
Method Details
-
lock
@NotNull ILockedMultiBlock lock(@NotNull org.bukkit.block.Block block, @NotNull org.bukkit.block.Block secondaryBlock, @NotNull ILockSecurityPlayer owner, @Nullable ZonedDateTime lockTime, @Nullable String nickname)Lock the blocks at the given locations with the supplied data.- Parameters:
block
- the primary block to locksecondaryBlock
- the secondary block to lockowner
- the owner of the locked blocklockTime
- the time at which the block was locked. If null, now will be usednickname
- the nickname for this block. Can be null- Returns:
- the
ILockedMultiBlock
instance - Throws:
IllegalArgumentException
- if either block or secondaryBlock is already locked
-
lock
@NotNull ILockedMultiBlock lock(@NotNull org.bukkit.block.Block block, @NotNull org.bukkit.block.Block secondaryBlock, @NotNull ILockSecurityPlayer owner, @Nullable ZonedDateTime lockTime)Lock the blocks at the given locations with the supplied data.- Parameters:
block
- the primary block to locksecondaryBlock
- the secondary block to lockowner
- the owner of the locked blocklockTime
- the time at which the block was locked. If null, now will be used- Returns:
- the
ILockedMultiBlock
instance - Throws:
IllegalArgumentException
- if either block or secondaryBlock is already locked
-
lock
@NotNull ILockedMultiBlock lock(@NotNull org.bukkit.block.Block block, @NotNull org.bukkit.block.Block secondaryBlock, @NotNull ILockSecurityPlayer owner, @Nullable String nickname)Lock the blocks at the given locations with the supplied data.- Parameters:
block
- the primary block to locksecondaryBlock
- the secondary block to lockowner
- the owner of the locked blocknickname
- the nickname for this block. Can be null- Returns:
- the
ILockedMultiBlock
instance - Throws:
IllegalArgumentException
- if either block or secondaryBlock is already locked
-
lock
@NotNull ILockedMultiBlock lock(@NotNull org.bukkit.block.Block block, @NotNull org.bukkit.block.Block secondaryBlock, @NotNull ILockSecurityPlayer owner)Lock the blocks at the given locations with the supplied data.- Parameters:
block
- the primary block to locksecondaryBlock
- the secondary block to lockowner
- the owner of the locked block- Returns:
- the
ILockedMultiBlock
instance - Throws:
IllegalArgumentException
- if either block or secondaryBlock is already locked
-
lock
@NotNull ILockedBlock lock(@NotNull org.bukkit.block.Block block, @NotNull ILockSecurityPlayer owner, @Nullable ZonedDateTime lockTime, @Nullable String nickname)Lock the block at the given location with the supplied data.- Parameters:
block
- the primary block to lockowner
- the owner of the locked blocklockTime
- the time at which the block was locked. If null, now will be usednickname
- the nickname for this block. Can be null- Returns:
- the
ILockedMultiBlock
instance - Throws:
IllegalArgumentException
- if either block or secondaryBlock is already locked
-
lock
@NotNull ILockedBlock lock(@NotNull org.bukkit.block.Block block, @NotNull ILockSecurityPlayer owner, @Nullable ZonedDateTime lockTime)Lock the block at the given location with the supplied data.- Parameters:
block
- the primary block to lockowner
- the owner of the locked blocklockTime
- the time at which the block was locked. If null, now will be used- Returns:
- the
ILockedMultiBlock
instance - Throws:
IllegalArgumentException
- if either block or secondaryBlock is already locked
-
lock
@NotNull ILockedBlock lock(@NotNull org.bukkit.block.Block block, @NotNull ILockSecurityPlayer owner, @Nullable String nickname)Lock the block at the given location with the supplied data.- Parameters:
block
- the primary block to lockowner
- the owner of the locked blocknickname
- the nickname for this block. Can be null- Returns:
- the
ILockedMultiBlock
instance - Throws:
IllegalArgumentException
- if either block or secondaryBlock is already locked
-
lock
@NotNull ILockedBlock lock(@NotNull org.bukkit.block.Block block, @NotNull ILockSecurityPlayer owner)Lock the block at the given location with the supplied data.- Parameters:
block
- the primary block to lockowner
- the owner of the locked block- Returns:
- the
ILockedMultiBlock
instance - Throws:
IllegalArgumentException
- if either block or secondaryBlock is already locked
-
unlock
boolean unlock(@NotNull org.bukkit.block.Block block)Unlock the block at the given location.- Parameters:
block
- the block to unlock- Returns:
- true if successfully unlocked, false if the block was not locked
-
getLockedBlock
Get theILockedBlock
at the givenBlock
if one is present.- Parameters:
block
- the block to get- Returns:
- the locked block. null if not locked
-
getLockedBlock
Get theILockedBlock
at the givenLocation
if one is present.- Parameters:
location
- the location whose block to get- Returns:
- the locked block. null if not locked
-
getLockedBlock
Get theILockedBlock
at the given position if one is present.- Parameters:
world
- the world in which the block should be fetched. Must not be nullx
- the x coordinate of the blocky
- the y coordinate of the blockz
- the z coordinate of the block- Returns:
- the locked block. null if not locked
-
isLocked
boolean isLocked(@NotNull org.bukkit.block.Block block)Check whether or not the provided block has been locked.- Parameters:
block
- the block to check- Returns:
- true if locked, false otherwise
-
isLocked
boolean isLocked(@NotNull org.bukkit.Location location)Check whether or not the block at the provided location has been locked.- Parameters:
location
- the location to check- Returns:
- true if locked, false otherwise
-
isLocked
boolean isLocked(@NotNull org.bukkit.World world, int x, int y, int z)Check whether or not the block at the provided position has been locked.- Parameters:
world
- the world to checkx
- the x coordinate to checky
- the y coordinate to checkz
- the z coordinate to check- Returns:
- true if locked, false otherwise
-
getLockedBlocks
Get an immutable collection of allILockedBlocks
owned by the specified player.- Parameters:
owner
- the player whose blocks to get- Returns:
- all locked blocks owned by the player
-
getLockedBlocks
Get an immutable collection of allILockedBlocks
owned by the specified player.- Parameters:
owner
- the player whose blocks to get- Returns:
- all locked blocks owned by the player
-
getLockedBlocks
Get an immutable collection of allILockedBlocks
on the server.- Returns:
- all locked blocks.
-