Class ForceResourcepacks

java.lang.Object
de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks
de.themoep.resourcepacksplugin.velocity.ForceResourcepacks
All Implemented Interfaces:
de.themoep.metrics.MoepMetrics.Plugin, ForceResourcepacksPlugin, de.themoep.resourcepacksplugin.core.ResourcepacksPlugin, de.themoep.resourcepacksplugin.velocity.libs.lang.velocity.Languaged

public class ForceResourcepacks extends de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks implements ForceResourcepacksPlugin
Copyright (C) 2016 Max Lee (https://github.com/Phoenix616/)
  • Field Summary

    Fields inherited from class de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks

    pluginCommand

    Fields inherited from interface de.themoep.resourcepacksplugin.core.ForceResourcepacksPlugin

    firstJoinSet
  • Constructor Summary

    Constructors
    Constructor
    Description
    ForceResourcepacks(com.velocitypowered.api.proxy.ProxyServer proxy, org.slf4j.Logger logger, Path dataFolder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    callPackStatusEvent(UUID playerId, ResourcePackStatus status, de.themoep.resourcepacksplugin.core.ResourcePack pack)
     
    void
    cancelTask(int taskId)
    Cancel a task with a specific id
    void
    clearPack(UUID playerId)
     
    void
    Disable the plugin
    void
    Execute a console command
    boolean
    executeCommand(UUID playerId, String command)
    Make a player execute a command
     
     
    de.themoep.resourcepacksplugin.core.ResourcePack
    getLocalPack(UUID playerId)
    Get a pack that depends on the implementation that the server runs on e.g.
    de.themoep.metrics.MoepMetrics
    Get our metrics
    Get the manager that manages all the packs and status actions
    Get the name of the current server (on Bungee or world (on Bukkit) a player is in
    de.themoep.resourcepacksplugin.core.commands.PluginCommandExecutor
    Get the main plugin command executor
     
    int
    getStoredCount(de.themoep.resourcepacksplugin.core.ResourcePack pack)
    Get the amount of players that have a certain pack stored
    Get the manager that manages all the user packs and statuses
    void
    handleJoin(com.velocitypowered.api.proxy.Player player)
     
    boolean
    hasPermission(UUID playerId, String permission)
    Check whether or not a player has a certain permission
    boolean
    Get whether the plugin successful enabled or not
    boolean
    Check whether or not a destination (world or server depending on implementation) exists
    void
    kick(UUID playerId, String message)
    Kick a player with a message
    boolean
     
    void
    onProxyInitialization(com.velocitypowered.api.event.proxy.ProxyInitializeEvent event)
     
    void
    onProxyShutdown(com.velocitypowered.api.event.proxy.ProxyShutdownEvent event)
     
    boolean
    Get whether or not actions only run when a pack was sent before
    int
    runTaskLater(Runnable runnable, int delay)
    Run a task later
    boolean
    sendActionBar(UUID playerId, String message)
    Send an actionbar message to a player
    boolean
    sendMessage(UUID playerId, String message)
    Send a message to a player
    protected void
    sendPack(com.velocitypowered.api.proxy.Player player, de.themoep.resourcepacksplugin.core.ResourcePack pack)
     
    boolean
    sendTitle(UUID playerId, String title, String subTitle)
    Send a title and subtitle to a player with default timings (10, 70, 20)
    boolean
    sendTitle(UUID playerId, String title, String subTitle, int fadeIn, int stay, int fadeOut)
    Send a title and subtitle to a player
    void
    sendTo(UUID playerId, String serverName, Consumer<Boolean> callback)
    Send a player to a server (on Bungee) or world (on Bukkit)

    Methods inherited from class de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks

    callPackSelectEvent, callPackSendEvent, checkPermission, checkPermission, clearPack, getComponents, getConfig, getConfigMap, getCurrentServer, getCurrentServerTracker, getDataFolder, getDescription, getLangLogger, getLogLevel, getMessage, getMessageChannelHandler, getName, getPermanentPackRemoveTime, getPlayer, getPlayer, getPlayer, getPlayerClientType, getPlayerProtocol, getPluginLogger, getProxy, getStoredPack, getStoredPacks, getVersion, hasBackend, hasMessage, isAuthenticated, isUsepackTemporary, log, log, logDebug, logDebug, registerCommand, reloadConfig, removePack, resendPack, resendPack, runAsyncTask, runTask, saveConfigChanges, sendMessage, sendMessage, sendPack, sendPackInfo, setAuthenticated, setBackend, setStoredPack, unsetBackend

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface de.themoep.resourcepacksplugin.velocity.libs.lang.velocity.Languaged

    getResourceAsStream

    Methods inherited from interface de.themoep.metrics.MoepMetrics.Plugin

    getName, getVersion, log, runAsyncTask

    Methods inherited from interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin

    callPackSelectEvent, callPackSendEvent, checkPermission, checkPermission, getConfigMap, getDataFolder, getLogLevel, getMessage, getMessage, getMessage, getName, getPermanentPackRemoveTime, getPlayer, getPlayer, getPlayerClientType, getPlayerPackFormat, getPlayerProtocol, getPluginLogger, getStoredPack, getVersion, hasMessage, isAuthenticated, isUsepackTemporary, log, log, logDebug, logDebug, reloadConfig, removePack, resendPack, runAsyncTask, runTask, saveConfigChanges, sendMessage, sendMessage, sendPack, sendPackInfo, setStoredPack, supportsMultiplePacks
  • Constructor Details

    • ForceResourcepacks

      @Inject public ForceResourcepacks(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)
      Overrides:
      onProxyInitialization in class de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks
    • onProxyShutdown

      public void onProxyShutdown(com.velocitypowered.api.event.proxy.ProxyShutdownEvent event)
    • isEnabled

      public boolean isEnabled()
      Get whether the plugin successful enabled or not
      Specified by:
      isEnabled in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
      Overrides:
      isEnabled in class de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks
      Returns:
      true if the plugin is enabled; false if not
    • loadConfig

      public boolean loadConfig()
      Specified by:
      loadConfig in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
      Overrides:
      loadConfig in class de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks
    • getInstance

      public static ForceResourcepacks getInstance()
    • sendPack

      protected void sendPack(com.velocitypowered.api.proxy.Player player, de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Overrides:
      sendPack in class de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks
    • clearPack

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

      public ActionManager getPackManager()
      Description copied from interface: ForceResourcepacksPlugin
      Get the manager that manages all the packs and status actions
      Specified by:
      getPackManager in interface ForceResourcepacksPlugin
      Specified by:
      getPackManager in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
      Overrides:
      getPackManager in class de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks
      Returns:
      The ActionManager
    • getUserManager

      public StatusManager getUserManager()
      Description copied from interface: ForceResourcepacksPlugin
      Get the manager that manages all the user packs and statuses
      Specified by:
      getUserManager in interface ForceResourcepacksPlugin
      Specified by:
      getUserManager in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
      Overrides:
      getUserManager in class de.themoep.resourcepacksplugin.velocity.VelocityResourcepacks
      Returns:
      The StatusManager
    • getMetrics

      public de.themoep.metrics.MoepMetrics getMetrics()
      Description copied from interface: ForceResourcepacksPlugin
      Get our metrics
      Specified by:
      getMetrics in interface ForceResourcepacksPlugin
      Returns:
      Our metrics
    • executeCommand

      public void executeCommand(String command)
      Description copied from interface: ForceResourcepacksPlugin
      Execute a console command
      Specified by:
      executeCommand in interface ForceResourcepacksPlugin
      Parameters:
      command - The command string to execute
    • executeCommand

      public boolean executeCommand(UUID playerId, String command)
      Description copied from interface: ForceResourcepacksPlugin
      Make a player execute a command
      Specified by:
      executeCommand in interface ForceResourcepacksPlugin
      Parameters:
      playerId - The UUID of the player
      command - The command string to execute
      Returns:
      true if the player was online; false if not
    • isValidDestination

      public boolean isValidDestination(String destination)
      Description copied from interface: ForceResourcepacksPlugin
      Check whether or not a destination (world or server depending on implementation) exists
      Specified by:
      isValidDestination in interface ForceResourcepacksPlugin
      Parameters:
      destination - The name of the destination to check
      Returns:
      true if it exists; false if not
    • getLocalPack

      public de.themoep.resourcepacksplugin.core.ResourcePack getLocalPack(UUID playerId)
      Description copied from interface: ForceResourcepacksPlugin
      Get a pack that depends on the implementation that the server runs on e.g. from a WorldGuard region
      Specified by:
      getLocalPack in interface ForceResourcepacksPlugin
      Parameters:
      playerId - The UUID of the player
      Returns:
      The pack or null if there is none
    • getStoredCount

      public int getStoredCount(de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Description copied from interface: ForceResourcepacksPlugin
      Get the amount of players that have a certain pack stored
      Specified by:
      getStoredCount in interface ForceResourcepacksPlugin
      Parameters:
      pack - The pack to check
      Returns:
      The times it is stored
    • getPluginCommand

      public de.themoep.resourcepacksplugin.core.commands.PluginCommandExecutor getPluginCommand()
      Description copied from interface: ForceResourcepacksPlugin
      Get the main plugin command executor
      Specified by:
      getPluginCommand in interface ForceResourcepacksPlugin
      Returns:
      The main plugin command executor
    • requirePackSendForActions

      public boolean requirePackSendForActions()
      Description copied from interface: ForceResourcepacksPlugin
      Get whether or not actions only run when a pack was sent before
      Specified by:
      requirePackSendForActions in interface ForceResourcepacksPlugin
      Returns:
      The value of the only-run-actions-after-pack-send config option
    • callPackStatusEvent

      public IResourcePackStatusEvent callPackStatusEvent(UUID playerId, ResourcePackStatus status, de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Specified by:
      callPackStatusEvent in interface ForceResourcepacksPlugin
    • handleJoin

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

      public String getServerVersion()
      Specified by:
      getServerVersion in interface ForceResourcepacksPlugin
      Specified by:
      getServerVersion in interface de.themoep.metrics.MoepMetrics.Plugin
    • runTaskLater

      public int runTaskLater(Runnable runnable, int delay)
      Description copied from interface: ForceResourcepacksPlugin
      Run a task later
      Specified by:
      runTaskLater in interface ForceResourcepacksPlugin
      Specified by:
      runTaskLater in interface de.themoep.metrics.MoepMetrics.Plugin
      Parameters:
      runnable - The Runnable to run
      delay - The delay in seconds after which to run the task
      Returns:
      The task's id
    • cancelTask

      public void cancelTask(int taskId)
      Description copied from interface: ForceResourcepacksPlugin
      Cancel a task with a specific id
      Specified by:
      cancelTask in interface ForceResourcepacksPlugin
      Parameters:
      taskId - The id of the task that should be cancelled
    • disable

      public void disable()
      Description copied from interface: ForceResourcepacksPlugin
      Disable the plugin
      Specified by:
      disable in interface ForceResourcepacksPlugin
    • getPlayerLocation

      public String getPlayerLocation(UUID playerId)
      Description copied from interface: ForceResourcepacksPlugin
      Get the name of the current server (on Bungee or world (on Bukkit) a player is in
      Specified by:
      getPlayerLocation in interface ForceResourcepacksPlugin
      Parameters:
      playerId - The UUID of the player
      Returns:
      The name of the world or server
    • kick

      public void kick(UUID playerId, String message)
      Description copied from interface: ForceResourcepacksPlugin
      Kick a player with a message
      Specified by:
      kick in interface ForceResourcepacksPlugin
      Parameters:
      playerId - The UUID of the player to kick
      message - The message to display. Ampersand colorcodes will get replaced
    • sendTo

      public void sendTo(UUID playerId, String serverName, Consumer<Boolean> callback)
      Description copied from interface: ForceResourcepacksPlugin
      Send a player to a server (on Bungee) or world (on Bukkit)
      Specified by:
      sendTo in interface ForceResourcepacksPlugin
      Parameters:
      playerId - The UUID of the player
      serverName - The name of the server or world
      callback - A callback executed when the player was moved and with its success state
    • sendMessage

      public boolean sendMessage(UUID playerId, String message)
      Description copied from interface: ForceResourcepacksPlugin
      Send a message to a player
      Specified by:
      sendMessage in interface ForceResourcepacksPlugin
      Specified by:
      sendMessage in interface de.themoep.metrics.MoepMetrics.Plugin
      Parameters:
      playerId - The UUID of the player
      message - The message to send. Ampersand colorcodes will get replaced
      Returns:
      true if the player is online; false if not
    • hasPermission

      public boolean hasPermission(UUID playerId, String permission)
      Description copied from interface: ForceResourcepacksPlugin
      Check whether or not a player has a certain permission
      Specified by:
      hasPermission in interface ForceResourcepacksPlugin
      Specified by:
      hasPermission in interface de.themoep.metrics.MoepMetrics.Plugin
      Parameters:
      playerId - The UUID of the player
      permission - The permission to check
      Returns:
      true if the player has the permission; false if not or the player is offline
    • getFile

      public File getFile()
      Specified by:
      getFile in interface de.themoep.metrics.MoepMetrics.Plugin
    • sendTitle

      public boolean sendTitle(UUID playerId, String title, String subTitle)
      Description copied from interface: ForceResourcepacksPlugin
      Send a title and subtitle to a player with default timings (10, 70, 20)
      Specified by:
      sendTitle in interface ForceResourcepacksPlugin
      Parameters:
      playerId - The UUID of the player
      title - The title to send. Ampersand colorcodes will get replaced
      subTitle - The subtitle to send. Ampersand colorcodes will get replaced
      Returns:
      true if the player is online; false if not
    • sendTitle

      public boolean sendTitle(UUID playerId, String title, String subTitle, int fadeIn, int stay, int fadeOut)
      Description copied from interface: ForceResourcepacksPlugin
      Send a title and subtitle to a player
      Specified by:
      sendTitle in interface ForceResourcepacksPlugin
      Parameters:
      playerId - The UUID of the player
      title - The title to send. Ampersand colorcodes will get replaced
      subTitle - The subtitle to send. Ampersand colorcodes will get replaced
      fadeIn - The fade in timing
      stay - The stay timing
      fadeOut - The fade out timing
      Returns:
      true if the player is online; false if not
    • sendActionBar

      public boolean sendActionBar(UUID playerId, String message)
      Description copied from interface: ForceResourcepacksPlugin
      Send an actionbar message to a player
      Specified by:
      sendActionBar in interface ForceResourcepacksPlugin
      Parameters:
      playerId - The UUID of the player
      message - The message to send. Ampersand colorcodes will get replaced
      Returns:
      true if the player is online; false if not