Package de.maxbossing.maxapi.UTils
Class PluginUtils
java.lang.Object
de.maxbossing.maxapi.UTils.PluginUtils
Utilities for managing plugins.
- Author:
- rylinaux
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconsolidateStrings(String[] args, int start) static voiddisable(org.bukkit.plugin.Plugin plugin) Disable a plugin.static voidDisable all plugins.static voidenable(org.bukkit.plugin.Plugin plugin) Enable a plugin.static voidEnable all plugins.findByCommand(String command) Find which plugin has a given command registered.static StringgetFormattedName(org.bukkit.plugin.Plugin plugin) Returns the formatted name of the plugin.static StringgetFormattedName(org.bukkit.plugin.Plugin plugin, boolean includeVersions) Returns the formatted name of the plugin.static org.bukkit.plugin.PlugingetPluginByName(String name) Returns a plugin from a String.static org.bukkit.plugin.PlugingetPluginByName(String[] args, int start) Returns a plugin from an array of Strings.getPluginNames(boolean fullName) Returns a List of plugin names.static StringgetPluginVersion(String name) Get the version of another plugin.static StringgetUsages(org.bukkit.plugin.Plugin plugin) Returns the commands a plugin has registered.static StringLoads and enables a plugin.static voidreload(org.bukkit.plugin.Plugin plugin) Reload a plugin.static voidReload all plugins.static Stringunload(org.bukkit.plugin.Plugin plugin) Unload a plugin.
-
Constructor Details
-
PluginUtils
public PluginUtils()
-
-
Method Details
-
enable
public static void enable(org.bukkit.plugin.Plugin plugin) Enable a plugin.- Parameters:
plugin- the plugin to enable
-
enableAll
public static void enableAll()Enable all plugins. -
disable
public static void disable(org.bukkit.plugin.Plugin plugin) Disable a plugin.- Parameters:
plugin- the plugin to disable
-
disableAll
public static void disableAll()Disable all plugins. -
getFormattedName
Returns the formatted name of the plugin.- Parameters:
plugin- the plugin to format- Returns:
- the formatted name
-
getFormattedName
Returns the formatted name of the plugin.- Parameters:
plugin- the plugin to formatincludeVersions- whether to include the version- Returns:
- the formatted name
-
getPluginByName
Returns a plugin from an array of Strings.- Parameters:
args- the arraystart- the index to start at- Returns:
- the plugin
-
getPluginByName
Returns a plugin from a String.- Parameters:
name- the name of the plugin- Returns:
- the plugin
-
getPluginNames
Returns a List of plugin names.- Returns:
- list of plugin names
-
getPluginVersion
Get the version of another plugin.- Parameters:
name- the name of the other plugin.- Returns:
- the version.
-
getUsages
Returns the commands a plugin has registered.- Parameters:
plugin- the plugin to deal with- Returns:
- the commands registered
-
findByCommand
Find which plugin has a given command registered.- Parameters:
command- the command.- Returns:
- the plugin.
-
load
Loads and enables a plugin.- Parameters:
name- plugin's name- Returns:
- status message
-
reload
public static void reload(org.bukkit.plugin.Plugin plugin) Reload a plugin.- Parameters:
plugin- the plugin to reload
-
reloadAll
public static void reloadAll()Reload all plugins. -
unload
Unload a plugin.- Parameters:
plugin- the plugin to unload- Returns:
- the message to send to the user.
-
consolidateStrings
-