Package wtf.choco.locksecurity.api
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 Summary
Modifier and Type Method Description static <T extends IKeyBuilder>
IKeyFactory<T>getKeyFactory(Class<T> type)
Get a key factory instance according to its type.static ILockedBlockManager
getLockedBlockManager()
Get theILockedBlockManager
instance.static ILockSecurityPlayer
getLockSecurityPlayer(org.bukkit.OfflinePlayer player)
Get anILockSecurityPlayer
wrapper for the givenOfflinePlayer
.static ILockSecurity
getPlugin()
Get an instance of the LockSecurity plugin API.static String
getVersion()
Get LockSecurity's plugin version.static boolean
isLockable(org.bukkit.Material material)
Get whether the suppliedMaterial
is lockable according to the LockSecurity configuration file.static void
setPlugin(ILockSecurity plugin)
Set the implementation for LockSecurity's API.
-
Method Details
-
setPlugin
Set the implementation for LockSecurity's API.WARNING: This is for implementation use ONLY
- Parameters:
plugin
- the API implementation
-
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
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 providedIKeyBuilder
is not supported by LockSecurity
-
getLockSecurityPlayer
@NotNull public static ILockSecurityPlayer getLockSecurityPlayer(@NotNull org.bukkit.OfflinePlayer player)Get anILockSecurityPlayer
wrapper for the givenOfflinePlayer
.- Parameters:
player
- the player whose wrapper to get. Must not be null- Returns:
- the lock security player wrapper
-
getLockedBlockManager
Get theILockedBlockManager
instance.- Returns:
- the locked block manager
-
isLockable
public static boolean isLockable(@NotNull org.bukkit.Material material)Get whether the suppliedMaterial
is lockable according to the LockSecurity configuration file.- Parameters:
material
- the material to check. Must not be null- Returns:
- true if lockable, false otherwise
-