Class LockSecurityAPI

java.lang.Object
wtf.choco.locksecurity.api.LockSecurityAPI

public final class LockSecurityAPI
extends Object
The LockSecurity API utility class. All methods in this class mirror that of ILockSecurity for the sake of utility.

This API is provided free of charge to developers as a means of integrating with the LockSecurity plugin without having to purchase and install the plugin from SpigotMC. The API may be distributed independently.

This API (including any interfaces found in the wtf.choco.locksecurity.api package) are not meant to be implemented.

Since:
3.0.0
Author:
Parker Hawke - Choco
  • Method Details

    • setPlugin

      public static void setPlugin​(ILockSecurity plugin)
      Set the implementation for LockSecurity's API.

      WARNING: This is for implementation use ONLY

      Parameters:
      plugin - the API implementation
    • getPlugin

      @NotNull public static ILockSecurity getPlugin()
      Get an instance of the LockSecurity plugin API.

      Note that this call is redundant in most cases. Where possible, you should prefer making calls to the static methods mirrored in LockSecurityAPI.

      Returns:
      the plugin API
    • getVersion

      @NotNull public static String getVersion()
      Get LockSecurity's plugin version.
      Returns:
      the plugin version
      Since:
      3.0.1
    • getKeyFactory

      @NotNull public static <T extends IKeyBuilder> IKeyFactory<T> getKeyFactory​(@NotNull Class<T> type)
      Get a key factory instance according to its type.
      Type Parameters:
      T - the type of key factory
      Parameters:
      type - the type of key factory
      Returns:
      the key factory. Must not be null
      Throws:
      UnsupportedOperationException - if the provided IKeyBuilder is not supported by LockSecurity
    • getLockSecurityPlayer

      @NotNull public static ILockSecurityPlayer getLockSecurityPlayer​(@NotNull org.bukkit.OfflinePlayer player)
      Get an ILockSecurityPlayer wrapper for the given OfflinePlayer.
      Parameters:
      player - the player whose wrapper to get. Must not be null
      Returns:
      the lock security player wrapper
    • getLockedBlockManager

      @NotNull public static ILockedBlockManager getLockedBlockManager()
      Get the ILockedBlockManager instance.
      Returns:
      the locked block manager
    • isLockable

      public static boolean isLockable​(@NotNull org.bukkit.Material material)
      Get whether the supplied Material is lockable according to the LockSecurity configuration file.
      Parameters:
      material - the material to check. Must not be null
      Returns:
      true if lockable, false otherwise