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
-
Method Summary
Modifier and TypeMethodDescriptioncallPackStatusEvent
(UUID playerId, ResourcePackStatus status, de.themoep.resourcepacksplugin.core.ResourcePack pack) void
cancelTask
(int taskId) Cancel a task with a specific idvoid
void
disable()
Disable the pluginvoid
executeCommand
(String command) Execute a console commandboolean
executeCommand
(UUID playerId, String command) Make a player execute a commandgetFile()
static ForceResourcepacks
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 metricsGet the manager that manages all the packs and status actionsgetPlayerLocation
(UUID playerId) Get the name of the current server (on Bungee or world (on Bukkit) a player is inde.themoep.resourcepacksplugin.core.commands.PluginCommandExecutor
Get the main plugin command executorint
getStoredCount
(de.themoep.resourcepacksplugin.core.ResourcePack pack) Get the amount of players that have a certain pack storedGet the manager that manages all the user packs and statusesde.themoep.resourcepacksplugin.bukkit.worldguard.WorldGuardHandler
boolean
hasPermission
(UUID playerId, String permission) Check whether or not a player has a certain permissionboolean
isValidDestination
(String destination) Check whether or not a destination (world or server depending on implementation) existsvoid
Kick a player with a messageboolean
void
onEnable()
void
onLoad()
void
reloadConfig
(boolean resend) Reloads the configuration from the file and resends the resource pack to all online playersboolean
Get whether or not actions only run when a pack was sent beforeint
runTaskLater
(Runnable runnable, int delay) Run a task laterboolean
sendActionBar
(UUID playerId, String message) Send an actionbar message to a playerboolean
sendMessage
(UUID playerId, String message) Send a message to a playervoid
sendPack
(org.bukkit.entity.Player player, de.themoep.resourcepacksplugin.core.ResourcePack pack) boolean
Send a title and subtitle to a player with default timings (10, 70, 20)boolean
Send a title and subtitle to a playervoid
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.resourcepacksplugin.core.ForceResourcepacksPlugin
calculateRequired, callPackStatusEvent, canBypass, clearFirstJoin, isFirstJoin, onQuit, setFirstJoin, setupCommands, startupMessage
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 interfaceorg.bukkit.plugin.Plugin
- Overrides:
onLoad
in classorg.bukkit.plugin.java.JavaPlugin
-
onEnable
public void onEnable()- Specified by:
onEnable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classde.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
-
loadConfig
public boolean loadConfig()- Specified by:
loadConfig
in interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
- Overrides:
loadConfig
in classde.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 interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
- Overrides:
reloadConfig
in classde.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
-
getInstance
-
sendPack
public void sendPack(org.bukkit.entity.Player player, de.themoep.resourcepacksplugin.core.ResourcePack pack) - Overrides:
sendPack
in classde.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
-
clearPack
- Specified by:
clearPack
in interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
- Overrides:
clearPack
in classde.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
-
getPackManager
Description copied from interface:ForceResourcepacksPlugin
Get the manager that manages all the packs and status actions- Specified by:
getPackManager
in interfaceForceResourcepacksPlugin
- Specified by:
getPackManager
in interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
- Overrides:
getPackManager
in classde.themoep.resourcepacksplugin.bukkit.WorldResourcepacks
- Returns:
- The ActionManager
-
getUserManager
Description copied from interface:ForceResourcepacksPlugin
Get the manager that manages all the user packs and statuses- Specified by:
getUserManager
in interfaceForceResourcepacksPlugin
- Specified by:
getUserManager
in interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
- Overrides:
getUserManager
in classde.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 interfaceForceResourcepacksPlugin
- Returns:
- Our metrics
-
executeCommand
Description copied from interface:ForceResourcepacksPlugin
Execute a console command- Specified by:
executeCommand
in interfaceForceResourcepacksPlugin
- Parameters:
command
- The command string to execute
-
executeCommand
Description copied from interface:ForceResourcepacksPlugin
Make a player execute a command- Specified by:
executeCommand
in interfaceForceResourcepacksPlugin
- Parameters:
playerId
- The UUID of the playercommand
- The command string to execute- Returns:
- true if the player was online; false if not
-
isValidDestination
Description copied from interface:ForceResourcepacksPlugin
Check whether or not a destination (world or server depending on implementation) exists- Specified by:
isValidDestination
in interfaceForceResourcepacksPlugin
- Parameters:
destination
- The name of the destination to check- Returns:
- true if it exists; false if not
-
getLocalPack
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 interfaceForceResourcepacksPlugin
- 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 interfaceForceResourcepacksPlugin
- 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 interfaceForceResourcepacksPlugin
-
getPluginCommand
public de.themoep.resourcepacksplugin.core.commands.PluginCommandExecutor getPluginCommand()Description copied from interface:ForceResourcepacksPlugin
Get the main plugin command executor- Specified by:
getPluginCommand
in interfaceForceResourcepacksPlugin
- 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 interfaceForceResourcepacksPlugin
- Returns:
- The value of the only-run-actions-after-pack-send config option
-
getServerVersion
- Specified by:
getServerVersion
in interfaceForceResourcepacksPlugin
- Specified by:
getServerVersion
in interfacede.themoep.metrics.MoepMetrics.Plugin
-
runTaskLater
Description copied from interface:ForceResourcepacksPlugin
Run a task later- Specified by:
runTaskLater
in interfaceForceResourcepacksPlugin
- Specified by:
runTaskLater
in interfacede.themoep.metrics.MoepMetrics.Plugin
- Parameters:
runnable
- The Runnable to rundelay
- 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 interfaceForceResourcepacksPlugin
- 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 interfaceForceResourcepacksPlugin
-
getPlayerLocation
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 interfaceForceResourcepacksPlugin
- Parameters:
playerId
- The UUID of the player- Returns:
- The name of the world or server
-
kick
Description copied from interface:ForceResourcepacksPlugin
Kick a player with a message- Specified by:
kick
in interfaceForceResourcepacksPlugin
- Parameters:
playerId
- The UUID of the player to kickmessage
- The message to display. Ampersand colorcodes will get replaced
-
sendTo
Description copied from interface:ForceResourcepacksPlugin
Send a player to a server (on Bungee) or world (on Bukkit)- Specified by:
sendTo
in interfaceForceResourcepacksPlugin
- Parameters:
playerId
- The UUID of the playerworldName
- The name of the server or worldcallback
- A callback executed when the player was moved and with its success state
-
sendMessage
Description copied from interface:ForceResourcepacksPlugin
Send a message to a player- Specified by:
sendMessage
in interfaceForceResourcepacksPlugin
- Specified by:
sendMessage
in interfacede.themoep.metrics.MoepMetrics.Plugin
- Parameters:
playerId
- The UUID of the playermessage
- The message to send. Ampersand colorcodes will get replaced- Returns:
- true if the player is online; false if not
-
hasPermission
Description copied from interface:ForceResourcepacksPlugin
Check whether or not a player has a certain permission- Specified by:
hasPermission
in interfaceForceResourcepacksPlugin
- Specified by:
hasPermission
in interfacede.themoep.metrics.MoepMetrics.Plugin
- Parameters:
playerId
- The UUID of the playerpermission
- The permission to check- Returns:
- true if the player has the permission; false if not or the player is offline
-
getFile
- Specified by:
getFile
in interfacede.themoep.metrics.MoepMetrics.Plugin
- Overrides:
getFile
in classorg.bukkit.plugin.java.JavaPlugin
-
sendTitle
Description copied from interface:ForceResourcepacksPlugin
Send a title and subtitle to a player with default timings (10, 70, 20)- Specified by:
sendTitle
in interfaceForceResourcepacksPlugin
- Parameters:
playerId
- The UUID of the playertitle
- The title to send. Ampersand colorcodes will get replacedsubTitle
- 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 interfaceForceResourcepacksPlugin
- Parameters:
playerId
- The UUID of the playertitle
- The title to send. Ampersand colorcodes will get replacedsubTitle
- The subtitle to send. Ampersand colorcodes will get replacedfadeIn
- The fade in timingstay
- The stay timingfadeOut
- The fade out timing- Returns:
- true if the player is online; false if not
-
sendActionBar
Description copied from interface:ForceResourcepacksPlugin
Send an actionbar message to a player- Specified by:
sendActionBar
in interfaceForceResourcepacksPlugin
- Parameters:
playerId
- The UUID of the playermessage
- 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)
-