Class VelocityResourcepacks
java.lang.Object
de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks
- All Implemented Interfaces:
de.themoep.resourcepacksplugin.core.ResourcepacksPlugin,de.themoep.utils.lang.velocity.Languaged
public class VelocityResourcepacks
extends Object
implements de.themoep.resourcepacksplugin.core.ResourcepacksPlugin, de.themoep.utils.lang.velocity.Languaged
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected de.themoep.resourcepacksplugin.core.commands.ResourcepacksPluginCommandExecutor -
Constructor Summary
ConstructorsConstructorDescriptionVelocityResourcepacks(com.velocitypowered.api.proxy.ProxyServer proxy, org.slf4j.Logger logger, Path dataFolder) -
Method Summary
Modifier and TypeMethodDescriptionde.themoep.resourcepacksplugin.core.events.IResourcePackSelectEventcallPackSelectEvent(UUID playerId, List<de.themoep.resourcepacksplugin.core.ResourcePack> packs, de.themoep.resourcepacksplugin.core.events.IResourcePackSelectEvent.Status status) de.themoep.resourcepacksplugin.core.events.IResourcePackSendEventcallPackSendEvent(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack) booleancheckPermission(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, String perm) booleancheckPermission(UUID playerId, String perm) voidclearPack(com.velocitypowered.api.proxy.Player player) voidnet.kyori.adventure.text.ComponentgetComponents(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer sender, String key, String... replacements) Get message components from the language configgetConfigMap(Object configuration) com.velocitypowered.api.proxy.server.RegisteredServergetCurrentServer(com.velocitypowered.api.proxy.Player player) Get the server the player is currently on or connecting toGet the tracker for getting the server a player is on or connecting tocom.velocitypowered.api.plugin.PluginDescriptionde.themoep.utils.lang.LangLoggergetMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer sender, String key, String... replacements) de.themoep.resourcepacksplugin.core.SubChannelHandler<com.velocitypowered.api.proxy.server.RegisteredServer> Get the handler for sub channels that listens on the "rp:plugin" channel to register new sub channelsgetName()de.themoep.resourcepacksplugin.core.PackManagerintde.themoep.resourcepacksplugin.core.PlatformTypede.themoep.resourcepacksplugin.core.ResourcepacksPlayergetPlayer(com.velocitypowered.api.proxy.Player player) de.themoep.resourcepacksplugin.core.ResourcepacksPlayerde.themoep.resourcepacksplugin.core.ResourcepacksPlayerde.themoep.resourcepacksplugin.core.ClientTypegetPlayerClientType(UUID playerId) intgetPlayerProtocol(UUID playerId) de.themoep.resourcepacksplugin.core.PluginLoggercom.velocitypowered.api.proxy.ProxyServergetProxy()getStoredPack(UUID playerId) de.themoep.resourcepacksplugin.core.UserManagerbooleanhasBackend(UUID playerId) Check if a player has a pack set by a backend serverbooleanhasMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer sender, String key) booleanisAuthenticated(UUID playerId) booleanGet whether the plugin successful enabled or notbooleanbooleanvoidvoidvoidvoidvoidonProxyInitialization(com.velocitypowered.api.event.proxy.ProxyInitializeEvent event) protected voidregisterCommand(de.themoep.resourcepacksplugin.core.commands.PluginCommandExecutor executor) voidreloadConfig(boolean resend) Reloads the configuration from the file and resends the resource pack to all online playersvoidremovePack(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack) voidresendPack(com.velocitypowered.api.proxy.Player player) Resends the pack that corresponds to the player's servervoidresendPack(UUID playerId) intrunAsyncTask(Runnable runnable) intvoidbooleansendMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, String key, String... replacements) booleansendMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, Level level, String key, String... replacements) protected voidsendPack(com.velocitypowered.api.proxy.Player player, de.themoep.resourcepacksplugin.core.ResourcePack pack) Send a resourcepack to a connected playervoidvoidsendPackInfo(UUID playerId) voidsetAuthenticated(UUID playerId, boolean b) voidsetBackend(UUID playerId) Add a player's UUID to the list of players with a backend packvoidsetStoredPack(UUID playerId, String packName) voidunsetBackend(UUID playerId) Remove a player's UUID from the list of players with a backend packMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.themoep.utils.lang.velocity.Languaged
getResourceAsStreamMethods inherited from interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
getMessage, getMessage, getPlayerPackFormat, startupMessage, supportsMultiplePacks
-
Field Details
-
pluginCommand
protected de.themoep.resourcepacksplugin.core.commands.ResourcepacksPluginCommandExecutor pluginCommand
-
-
Constructor Details
-
VelocityResourcepacks
@Inject public VelocityResourcepacks(com.velocitypowered.api.proxy.ProxyServer proxy, org.slf4j.Logger logger, Path dataFolder)
-
-
Method Details
-
onProxyInitialization
public void onProxyInitialization(com.velocitypowered.api.event.proxy.ProxyInitializeEvent event) -
registerCommand
protected void registerCommand(de.themoep.resourcepacksplugin.core.commands.PluginCommandExecutor executor) -
loadConfig
public boolean loadConfig()- Specified by:
loadConfigin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getConfigMap
- Specified by:
getConfigMapin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
reloadConfig
public void reloadConfig(boolean resend) Reloads the configuration from the file and resends the resource pack to all online players- Specified by:
reloadConfigin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
saveConfigChanges
public void saveConfigChanges()- Specified by:
saveConfigChangesin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
setStoredPack
- Specified by:
setStoredPackin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getStoredPack
- Specified by:
getStoredPackin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getStoredPacks
-
isUsepackTemporary
public boolean isUsepackTemporary()- Specified by:
isUsepackTemporaryin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getPermanentPackRemoveTime
public int getPermanentPackRemoveTime()- Specified by:
getPermanentPackRemoveTimein interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getPlatformType
public de.themoep.resourcepacksplugin.core.PlatformType getPlatformType()- Specified by:
getPlatformTypein interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getConfig
-
isEnabled
public boolean isEnabled()Get whether the plugin successful enabled or not- Specified by:
isEnabledin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin- Returns:
- Whether or not the plugin was enabled
-
resendPack
public void resendPack(com.velocitypowered.api.proxy.Player player) Resends the pack that corresponds to the player's server- Parameters:
player- The player to set the pack for
-
resendPack
- Specified by:
resendPackin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
sendPack
protected void sendPack(com.velocitypowered.api.proxy.Player player, de.themoep.resourcepacksplugin.core.ResourcePack pack) Send a resourcepack to a connected player- Parameters:
player- The Player to send the pack topack- The resourcepack to send the pack to
-
sendPackInfo
- Specified by:
sendPackInfoin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getCurrentServer
public com.velocitypowered.api.proxy.server.RegisteredServer getCurrentServer(com.velocitypowered.api.proxy.Player player) Get the server the player is currently on or connecting to- Parameters:
player- The player- Returns:
- The name of the server
-
sendPack
- Specified by:
sendPackin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
removePack
- Specified by:
removePackin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
clearPack
public void clearPack(com.velocitypowered.api.proxy.Player player) -
clearPack
- Specified by:
clearPackin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getPackManager
public de.themoep.resourcepacksplugin.core.PackManager getPackManager()- Specified by:
getPackManagerin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getUserManager
public de.themoep.resourcepacksplugin.core.UserManager getUserManager()- Specified by:
getUserManagerin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
setBackend
Add a player's UUID to the list of players with a backend pack- Parameters:
playerId- The uuid of the player
-
unsetBackend
Remove a player's UUID from the list of players with a backend pack- Parameters:
playerId- The uuid of the player
-
hasBackend
Check if a player has a pack set by a backend server- Parameters:
playerId- The UUID of the player- Returns:
- If the player has a backend pack
-
getMessage
public String getMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer sender, String key, String... replacements) - Specified by:
getMessagein interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getComponents
public net.kyori.adventure.text.Component getComponents(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer sender, String key, String... replacements) Get message components from the language config- Parameters:
sender- The sender to get the message from, will use the client language if availablekey- The message keyreplacements- Optional placeholder replacement array- Returns:
- The components or an error message if not available, never null
-
hasMessage
public boolean hasMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer sender, String key) - Specified by:
hasMessagein interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getName
- Specified by:
getNamein interfacede.themoep.utils.lang.velocity.Languaged- Specified by:
getNamein interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getVersion
- Specified by:
getVersionin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getProxy
public com.velocitypowered.api.proxy.ProxyServer getProxy() -
getPluginLogger
public de.themoep.resourcepacksplugin.core.PluginLogger getPluginLogger()- Specified by:
getPluginLoggerin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getLangLogger
public de.themoep.utils.lang.LangLogger getLangLogger()- Specified by:
getLangLoggerin interfacede.themoep.utils.lang.velocity.Languaged
-
getDataFolder
- Specified by:
getDataFolderin interfacede.themoep.utils.lang.velocity.Languaged- Specified by:
getDataFolderin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getDescription
public com.velocitypowered.api.plugin.PluginDescription getDescription() -
logDebug
- Specified by:
logDebugin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
logDebug
- Specified by:
logDebugin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getLogLevel
- Specified by:
getLogLevelin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getPlayer
- Specified by:
getPlayerin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getPlayer
- Specified by:
getPlayerin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getPlayer
public de.themoep.resourcepacksplugin.core.ResourcepacksPlayer getPlayer(com.velocitypowered.api.proxy.Player player) -
sendMessage
public boolean sendMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, String key, String... replacements) - Specified by:
sendMessagein interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
sendMessage
public boolean sendMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, Level level, String key, String... replacements) - Specified by:
sendMessagein interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
log
- Specified by:
login interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
log
- Specified by:
login interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
checkPermission
public boolean checkPermission(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, String perm) - Specified by:
checkPermissionin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
checkPermission
- Specified by:
checkPermissionin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getPlayerProtocol
- Specified by:
getPlayerProtocolin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
getPlayerClientType
- Specified by:
getPlayerClientTypein interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
callPackSelectEvent
public de.themoep.resourcepacksplugin.core.events.IResourcePackSelectEvent callPackSelectEvent(UUID playerId, List<de.themoep.resourcepacksplugin.core.ResourcePack> packs, de.themoep.resourcepacksplugin.core.events.IResourcePackSelectEvent.Status status) - Specified by:
callPackSelectEventin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
callPackSendEvent
public de.themoep.resourcepacksplugin.core.events.IResourcePackSendEvent callPackSendEvent(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack) - Specified by:
callPackSendEventin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
isAuthenticated
- Specified by:
isAuthenticatedin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
runTask
- Specified by:
runTaskin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
runAsyncTask
- Specified by:
runAsyncTaskin interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
-
setAuthenticated
-
getMessageChannelHandler
public de.themoep.resourcepacksplugin.core.SubChannelHandler<com.velocitypowered.api.proxy.server.RegisteredServer> getMessageChannelHandler()Get the handler for sub channels that listens on the "rp:plugin" channel to register new sub channels- Returns:
- The message channel handler
-
getCurrentServerTracker
Get the tracker for getting the server a player is on or connecting to- Returns:
- The tracker
-