Interface LuckPermsBootstrap
public interface LuckPermsBootstrap
Bootstrap plugin interface
Instances of this interface are responsible for loading the "LuckPerms plugin" on their respective platforms.
-
Method Summary
Modifier and TypeMethodDescriptionGets aClassPathAppenderfor this bootstrap plugindefault PathGets the plugins configuration directoryGets the plugins main data storage directoryReturns a countdown latch whichcounts downafter the plugin has enabled.Returns a countdown latch whichcounts downafter the plugin has loaded.Gets the UUIDs of the users online on the platformOptional<?> Gets a player object linked to this User.intGets the number of users online on the platformGets the usernames of the users online on the platformGets the plugin loggerdefault InputStreamgetResourceStream(String path) Gets a bundled resource file from the jarGets an adapter for the platforms schedulerGets the name or "brand" of the running platformGets the name associated with this serverGets the version of the running platformGets the time when the plugin first started in millis.net.luckperms.api.platform.Platform.TypegetType()Gets the platform type this instance of LuckPerms is running on.Gets a string of the plugin's versionidentifyClassLoader(ClassLoader classLoader) Attempts to identify the plugin behind the given classloader.booleanisPlayerOnline(UUID uniqueId) Checks if a user is onlinelookupUniqueId(String username) Lookup a uuid from a username, using the servers internal uuid cache.lookupUsername(UUID uniqueId) Lookup a username from a uuid, using the servers internal uuid cache.
-
Method Details
-
getPluginLogger
PluginLogger getPluginLogger()Gets the plugin logger- Returns:
- the logger
-
getScheduler
SchedulerAdapter getScheduler()Gets an adapter for the platforms scheduler- Returns:
- the scheduler
-
getClassPathAppender
ClassPathAppender getClassPathAppender()Gets aClassPathAppenderfor this bootstrap plugin- Returns:
- a class path appender
-
getLoadLatch
CountDownLatch getLoadLatch()Returns a countdown latch whichcounts downafter the plugin has loaded.- Returns:
- a loading latch
-
getEnableLatch
CountDownLatch getEnableLatch()Returns a countdown latch whichcounts downafter the plugin has enabled.- Returns:
- an enable latch
-
getVersion
String getVersion()Gets a string of the plugin's version- Returns:
- the version of the plugin
-
getStartupTime
Instant getStartupTime()Gets the time when the plugin first started in millis.- Returns:
- the enable time
-
getType
net.luckperms.api.platform.Platform.Type getType()Gets the platform type this instance of LuckPerms is running on.- Returns:
- the platform type
-
getServerBrand
String getServerBrand()Gets the name or "brand" of the running platform- Returns:
- the server brand
-
getServerVersion
String getServerVersion()Gets the version of the running platform- Returns:
- the server version
-
getServerName
Gets the name associated with this server- Returns:
- the server name
-
getDataDirectory
Path getDataDirectory()Gets the plugins main data storage directoryBukkit: ./plugins/LuckPerms
BungeeCord: ./plugins/LuckPerms
Sponge: ./luckperms/
Velocity: ./plugins/luckperms
Fabric: ./mods/LuckPerms
Forge: ./config/luckperms
- Returns:
- the platforms data folder
-
getConfigDirectory
Gets the plugins configuration directory- Returns:
- the config directory
-
getResourceStream
Gets a bundled resource file from the jar- Parameters:
path- the path of the file- Returns:
- the file as an input stream
-
getPlayer
Gets a player object linked to this User. The returned object must be the same type as the instance used in the platforms ContextManager- Parameters:
uniqueId- the users unique id- Returns:
- a player object, or null, if one couldn't be found.
-
lookupUniqueId
Lookup a uuid from a username, using the servers internal uuid cache.- Parameters:
username- the username to lookup- Returns:
- an optional uuid, if found
-
lookupUsername
Lookup a username from a uuid, using the servers internal uuid cache.- Parameters:
uniqueId- the uuid to lookup- Returns:
- an optional username, if found
-
getPlayerCount
int getPlayerCount()Gets the number of users online on the platform- Returns:
- the number of users
-
getPlayerList
Collection<String> getPlayerList()Gets the usernames of the users online on the platform- Returns:
- a
Listof usernames
-
getOnlinePlayers
Collection<UUID> getOnlinePlayers()Gets the UUIDs of the users online on the platform- Returns:
- a
Setof UUIDs
-
isPlayerOnline
Checks if a user is online- Parameters:
uniqueId- the users external uuid- Returns:
- true if the user is online
-
identifyClassLoader
Attempts to identify the plugin behind the given classloader.Used for giving more helpful log messages when things break.
- Parameters:
classLoader- the classloader to identify- Returns:
- the name of the classloader source
- Throws:
Exception- anything
-