Class ForceResourcepacks
java.lang.Object
net.md_5.bungee.api.plugin.Plugin
de.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
de.themoep.resourcepacksplugin.bungee.ForceResourcepacks
- All Implemented Interfaces:
de.themoep.metrics.MoepMetrics.Plugin
,ForceResourcepacksPlugin
,de.themoep.resourcepacksplugin.core.ResourcepacksPlugin
public class ForceResourcepacks
extends de.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
implements ForceResourcepacksPlugin
Copyright (C) 2016 Max Lee (https://github.com/Phoenix616/)
-
Field Summary
Fields inherited from class de.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
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 commandstatic 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 statusesvoid
handleJoin
(net.md_5.bungee.api.connection.ProxiedPlayer player) boolean
hasPermission
(UUID playerId, String permission) Check whether or not a player has a certain permissionboolean
Get whether the plugin successful enabled or notboolean
isValidDestination
(String destination) Check whether or not a destination (world or server depending on implementation) existsvoid
Kick a player with a messageboolean
void
void
onEnable()
boolean
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 playerprotected void
sendPack
(net.md_5.bungee.api.connection.ProxiedPlayer 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)Methods inherited from class de.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
callPackSelectEvent, callPackSendEvent, checkPermission, checkPermission, clearPack, getBungeeVersion, getComponents, getConfig, getConfigMap, getLogLevel, getMessage, getMessageChannelHandler, getName, getPermanentPackRemoveTime, getPlayer, getPlayer, getPlayer, getPlayerClientType, getPlayerProtocol, getPluginLogger, getStoredPack, getStoredPacks, getVersion, hasBackend, hasMessage, isAuthenticated, isUsepackTemporary, log, log, logDebug, logDebug, registerCommand, registerPacket, reloadConfig, removePack, resendPack, resendPack, runAsyncTask, runTask, saveConfigChanges, sendMessage, sendMessage, sendPack, sendPackInfo, setAuthenticated, setBackend, setStoredPack, unsetBackend
Methods inherited from class net.md_5.bungee.api.plugin.Plugin
getDataFolder, getDescription, getExecutorService, getFile, getLogger, getProxy, getResourceAsStream, onLoad
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.core.ForceResourcepacksPlugin
calculateRequired, callPackStatusEvent, canBypass, clearFirstJoin, isFirstJoin, onQuit, setFirstJoin, setupCommands, startupMessage
Methods inherited from interface de.themoep.metrics.MoepMetrics.Plugin
getFile, 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
public ForceResourcepacks()
-
-
Method Details
-
onEnable
public void onEnable()- Overrides:
onEnable
in classde.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
-
onDisable
public void onDisable()- Overrides:
onDisable
in classnet.md_5.bungee.api.plugin.Plugin
-
isEnabled
public boolean isEnabled()Get whether the plugin successful enabled or not- Specified by:
isEnabled
in interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
- Overrides:
isEnabled
in classde.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
- Returns:
- true if the plugin is enabled; false if not
-
loadConfig
public boolean loadConfig()- Specified by:
loadConfig
in interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
- Overrides:
loadConfig
in classde.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
-
getInstance
-
sendPack
protected void sendPack(net.md_5.bungee.api.connection.ProxiedPlayer player, de.themoep.resourcepacksplugin.core.ResourcePack pack) - Overrides:
sendPack
in classde.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
-
clearPack
- Specified by:
clearPack
in interfacede.themoep.resourcepacksplugin.core.ResourcepacksPlugin
- Overrides:
clearPack
in classde.themoep.resourcepacksplugin.bungee.BungeeResourcepacks
-
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.bungee.BungeeResourcepacks
- 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.bungee.BungeeResourcepacks
- 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
-
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
-
callPackStatusEvent
public IResourcePackStatusEvent callPackStatusEvent(UUID playerId, ResourcePackStatus status, de.themoep.resourcepacksplugin.core.ResourcePack pack) - Specified by:
callPackStatusEvent
in interfaceForceResourcepacksPlugin
-
handleJoin
public void handleJoin(net.md_5.bungee.api.connection.ProxiedPlayer player) -
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 playerserverName
- 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
-
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
-