Class ForceResourcepacks

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
de.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
de.themoep.resourcepacksplugin.bukkit.ForceResourcepacks
All Implemented Interfaces:
de.themoep.metrics.MoepMetrics.Plugin, ForceResourcepacksPlugin, de.themoep.resourcepacksplugin.core.ResourcepacksPlugin, org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

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

    Fields inherited from class de.themoep.resourcepacksplugin.bukkit.WorldResourcepacks

    pluginCommand

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

    firstJoinSet
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • 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
    de.themoep.resourcepacksplugin.bukkit.worldguard.WorldGuardHandler
     
    boolean
    hasPermission(UUID playerId, String permission)
    Check whether or not a player has a certain permission
    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
     
    void
     
    void
    reloadConfig(boolean resend)
    Reloads the configuration from the file and resends the resource pack to all online players
    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
    void
    sendPack(org.bukkit.entity.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 worldName, Consumer<Boolean> callback)
    Send a player to a server (on Bungee) or world (on Bukkit)
    void
    setWorldGuardHandler(de.themoep.resourcepacksplugin.bukkit.worldguard.WorldGuardHandler worldGuardHandler)
     

    Methods inherited from class de.themoep.resourcepacksplugin.bukkit.WorldResourcepacks

    callPackSelectEvent, callPackSendEvent, checkPermission, checkPermission, clearPack, getComponents, getConfigMap, getInternalHelper, getLogLevel, getMessage, getMessageChannelHandler, getPermanentPackRemoveTime, getPlayer, getPlayer, getPlayer, getPlayerClientType, getPlayerProtocol, getPluginLogger, getStoredPack, getStoredPacks, getVersion, hasMessage, isAuthenticated, isUsepackTemporary, log, log, logDebug, logDebug, onDisable, registerCommand, removePack, removePack, removePacks, removePacks, resendPack, resendPack, runAsyncTask, runTask, saveConfigChanges, sendMessage, sendMessage, sendPack, sendPackInfo, setStoredPack

    Methods inherited from class org.bukkit.plugin.java.JavaPlugin

    getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString

    Methods inherited from class org.bukkit.plugin.PluginBase

    equals, getName, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    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, isEnabled, isUsepackTemporary, log, log, logDebug, logDebug, removePack, resendPack, runAsyncTask, runTask, saveConfigChanges, sendMessage, sendMessage, sendPack, sendPackInfo, setStoredPack, supportsMultiplePacks
  • Constructor Details

    • ForceResourcepacks

      public ForceResourcepacks()
  • Method Details

    • onLoad

      public void onLoad()
      Specified by:
      onLoad in interface org.bukkit.plugin.Plugin
      Overrides:
      onLoad in class org.bukkit.plugin.java.JavaPlugin
    • onEnable

      public void onEnable()
      Specified by:
      onEnable in interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class de.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
    • loadConfig

      public boolean loadConfig()
      Specified by:
      loadConfig in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
      Overrides:
      loadConfig in class de.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
    • 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
      Overrides:
      reloadConfig in class de.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
    • getInstance

      public static ForceResourcepacks getInstance()
    • sendPack

      public void sendPack(org.bukkit.entity.Player player, de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Overrides:
      sendPack in class de.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
    • clearPack

      public void clearPack(UUID playerId)
      Specified by:
      clearPack in interface de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
      Overrides:
      clearPack in class de.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
    • 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.bukkit.WorldResourcepacks
      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.bukkit.WorldResourcepacks
      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
    • callPackStatusEvent

      public IResourcePackStatusEvent callPackStatusEvent(UUID playerId, ResourcePackStatus status, de.themoep.resourcepacksplugin.core.ResourcePack pack)
      Specified by:
      callPackStatusEvent in interface ForceResourcepacksPlugin
    • 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
    • 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 worldName, 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
      worldName - 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
      Overrides:
      getFile in class org.bukkit.plugin.java.JavaPlugin
    • 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
    • getWorldGuardHandler

      public de.themoep.resourcepacksplugin.bukkit.worldguard.WorldGuardHandler getWorldGuardHandler()
    • setWorldGuardHandler

      public void setWorldGuardHandler(de.themoep.resourcepacksplugin.bukkit.worldguard.WorldGuardHandler worldGuardHandler)