Interface ILockedBlockManager


public interface ILockedBlockManager
Represents a manager to handle all ILockedBlocks on the server.
Since:
3.0.0
Author:
Parker Hawke - Choco
  • 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 lock
      secondaryBlock - the secondary block to lock
      owner - the owner of the locked block
      lockTime - the time at which the block was locked. If null, now will be used
      nickname - 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 lock
      secondaryBlock - the secondary block to lock
      owner - the owner of the locked block
      lockTime - 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 lock
      secondaryBlock - the secondary block to lock
      owner - the owner of the locked block
      nickname - 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 lock
      secondaryBlock - the secondary block to lock
      owner - 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 lock
      owner - the owner of the locked block
      lockTime - the time at which the block was locked. If null, now will be used
      nickname - 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 lock
      owner - the owner of the locked block
      lockTime - 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 lock
      owner - the owner of the locked block
      nickname - 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 lock
      owner - 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

      @Nullable ILockedBlock getLockedBlock​(@NotNull org.bukkit.block.Block block)
      Get the ILockedBlock at the given Block if one is present.
      Parameters:
      block - the block to get
      Returns:
      the locked block. null if not locked
    • getLockedBlock

      @Nullable ILockedBlock getLockedBlock​(@NotNull org.bukkit.Location location)
      Get the ILockedBlock at the given Location if one is present.
      Parameters:
      location - the location whose block to get
      Returns:
      the locked block. null if not locked
    • getLockedBlock

      @Nullable ILockedBlock getLockedBlock​(@NotNull org.bukkit.World world, int x, int y, int z)
      Get the ILockedBlock at the given position if one is present.
      Parameters:
      world - the world in which the block should be fetched. Must not be null
      x - the x coordinate of the block
      y - the y coordinate of the block
      z - 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 check
      x - the x coordinate to check
      y - the y coordinate to check
      z - the z coordinate to check
      Returns:
      true if locked, false otherwise
    • getLockedBlocks

      @NotNull Collection<ILockedBlock> getLockedBlocks​(@NotNull ILockSecurityPlayer owner)
      Get an immutable collection of all ILockedBlocks owned by the specified player.
      Parameters:
      owner - the player whose blocks to get
      Returns:
      all locked blocks owned by the player
    • getLockedBlocks

      @NotNull Collection<ILockedBlock> getLockedBlocks​(@NotNull org.bukkit.OfflinePlayer owner)
      Get an immutable collection of all ILockedBlocks owned by the specified player.
      Parameters:
      owner - the player whose blocks to get
      Returns:
      all locked blocks owned by the player
    • getLockedBlocks

      @NotNull Collection<ILockedBlock> getLockedBlocks()
      Get an immutable collection of all ILockedBlocks on the server.
      Returns:
      all locked blocks.