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 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:
      loadConfig in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getConfigMap

      public Map<String,Object> getConfigMap(Object configuration)
      Specified by:
      getConfigMap in interface de.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:
      reloadConfig in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • saveConfigChanges

      public void saveConfigChanges()
      Specified by:
      saveConfigChanges in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • setStoredPack

      public void setStoredPack(UUID playerId, String packName)
      Specified by:
      setStoredPack in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getStoredPack

      public String getStoredPack(UUID playerId)
      Specified by:
      getStoredPack in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getStoredPacks

      public Map<String,Object> getStoredPacks()
    • isUsepackTemporary

      public boolean isUsepackTemporary()
      Specified by:
      isUsepackTemporary in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getPermanentPackRemoveTime

      public int getPermanentPackRemoveTime()
      Specified by:
      getPermanentPackRemoveTime in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getPlatformType

      public de.themoep.resourcepacksplugin.core.PlatformType getPlatformType()
      Specified by:
      getPlatformType in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getConfig

      public PluginConfig getConfig()
    • isEnabled

      public boolean isEnabled()
      Get whether the plugin successful enabled or not
      Specified by:
      isEnabled in interface de.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

      public void resendPack(UUID playerId)
      Specified by:
      resendPack in interface de.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 to
      pack - The resourcepack to send the pack to
    • sendPackInfo

      public void sendPackInfo(UUID playerId)
      Specified by:
      sendPackInfo in interface de.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

      public void sendPack(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Specified by:
      sendPack in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • removePack

      public void removePack(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Specified by:
      removePack in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • clearPack

      public void clearPack(com.velocitypowered.api.proxy.Player player)
    • clearPack

      public void clearPack(UUID playerId)
      Specified by:
      clearPack in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getPackManager

      public de.themoep.resourcepacksplugin.core.PackManager getPackManager()
      Specified by:
      getPackManager in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getUserManager

      public de.themoep.resourcepacksplugin.core.UserManager getUserManager()
      Specified by:
      getUserManager in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • setBackend

      public void setBackend(UUID playerId)
      Add a player's UUID to the list of players with a backend pack
      Parameters:
      playerId - The uuid of the player
    • unsetBackend

      public void unsetBackend(UUID playerId)
      Remove a player's UUID from the list of players with a backend pack
      Parameters:
      playerId - The uuid of the player
    • hasBackend

      public boolean hasBackend(UUID playerId)
      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:
      getMessage in interface de.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 available
      key - The message key
      replacements - 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:
      hasMessage in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getName

      public String getName()
      Specified by:
      getName in interface de.themoep.utils.lang.velocity.Languaged
      Specified by:
      getName in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getVersion

      public String getVersion()
      Specified by:
      getVersion in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getProxy

      public com.velocitypowered.api.proxy.ProxyServer getProxy()
    • getPluginLogger

      public de.themoep.resourcepacksplugin.core.PluginLogger getPluginLogger()
      Specified by:
      getPluginLogger in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getLangLogger

      public de.themoep.utils.lang.LangLogger getLangLogger()
      Specified by:
      getLangLogger in interface de.themoep.utils.lang.velocity.Languaged
    • getDataFolder

      public File getDataFolder()
      Specified by:
      getDataFolder in interface de.themoep.utils.lang.velocity.Languaged
      Specified by:
      getDataFolder in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getDescription

      public com.velocitypowered.api.plugin.PluginDescription getDescription()
    • logDebug

      public void logDebug(String message)
      Specified by:
      logDebug in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • logDebug

      public void logDebug(String message, Throwable throwable)
      Specified by:
      logDebug in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getLogLevel

      public Level getLogLevel()
      Specified by:
      getLogLevel in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getPlayer

      public de.themoep.resourcepacksplugin.core.ResourcepacksPlayer getPlayer(UUID playerId)
      Specified by:
      getPlayer in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getPlayer

      public de.themoep.resourcepacksplugin.core.ResourcepacksPlayer getPlayer(String playerName)
      Specified by:
      getPlayer in interface de.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:
      sendMessage in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • sendMessage

      public boolean sendMessage(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, Level level, String key, String... replacements)
      Specified by:
      sendMessage in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • log

      public void log(Level level, String message)
      Specified by:
      log in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • log

      public void log(Level level, String message, Throwable throwable)
      Specified by:
      log in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • checkPermission

      public boolean checkPermission(de.themoep.resourcepacksplugin.core.ResourcepacksPlayer player, String perm)
      Specified by:
      checkPermission in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • checkPermission

      public boolean checkPermission(UUID playerId, String perm)
      Specified by:
      checkPermission in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getPlayerProtocol

      public int getPlayerProtocol(UUID playerId)
      Specified by:
      getPlayerProtocol in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • getPlayerClientType

      public de.themoep.resourcepacksplugin.core.ClientType getPlayerClientType(UUID playerId)
      Specified by:
      getPlayerClientType in interface de.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:
      callPackSelectEvent in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • callPackSendEvent

      public de.themoep.resourcepacksplugin.core.events.IResourcePackSendEvent callPackSendEvent(UUID playerId, de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Specified by:
      callPackSendEvent in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • isAuthenticated

      public boolean isAuthenticated(UUID playerId)
      Specified by:
      isAuthenticated in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • runTask

      public int runTask(Runnable runnable)
      Specified by:
      runTask in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • runAsyncTask

      public int runAsyncTask(Runnable runnable)
      Specified by:
      runAsyncTask in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
    • setAuthenticated

      public void setAuthenticated(UUID playerId, boolean b)
    • 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

      public CurrentServerTracker getCurrentServerTracker()
      Get the tracker for getting the server a player is on or connecting to
      Returns:
      The tracker