Package studio.magemonkey.fabled
Class Fabled
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
com.sucy.skill.SkillAPI
studio.magemonkey.fabled.Fabled
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
,org.bukkit.command.TabCompleter
,org.bukkit.command.TabExecutor
,org.bukkit.plugin.Plugin
The main class of the plugin which has the accessor methods into most of the API
You can retrieve a reference to this through Bukkit the same way as any other plugin
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClass
(FabledClass fabledClass) Registers a new class with Fabled.void
addClasses
(FabledClass... classes) Registers a new class with Fabled.void
addDynamicClass
(DynamicClass rpgClass) Adds a dynamic class which ignores validation.void
addDynamicSkill
(DynamicSkill skill) This adds a dynamic skill to the skill list.void
Registers a new skill with Fabled.void
Registers multiple new skills with Fabled.static IAttributeManager
Retrieves the attribute manager for Fabledstatic List
<FabledClass> getBaseClasses
(String group) Retrieves a list of base classes that don't profess from another classstatic FabledClass
Retrieves a class by name.static Map
<String, FabledClass> Retrieves the registered class data for Fabled.static ComboManager
Retrieves the manager for click cast combosstatic studio.magemonkey.codex.mccore.config.CommentedConfig
Grabs a config for Fabledstatic PlayerData
getData
(org.bukkit.OfflinePlayer player) Retrieves the active class data for the player.Retrieves the list of active class groups used by registered classesstatic IOManager
getIO()
Retrieves the IO manager for Fabledstatic studio.magemonkey.codex.mccore.config.CommentedLanguageConfig
Retrieves the language file data for Fabledstatic Object
Retrieves metadata from an entitystatic double
getMetaDouble
(org.bukkit.metadata.Metadatable target, String key) Retrieves metadata from an entitystatic int
getMetaInt
(org.bukkit.metadata.Metadatable target, String key) Retrieves metadata from an entitystatic PlayerAccounts
getPlayerAccounts
(org.bukkit.OfflinePlayer player) Retrieves all class data for the player.static Settings
Retrieves the settings data controlling Fabledstatic Skill
Retrieves a skill by name.Retrieves the registered skill data for Fabled.static boolean
hasPlayerData
(org.bukkit.OfflinePlayer player) Checks whether Fabled currently has loaded data for the given player.static Fabled
inst()
static boolean
isClassRegistered
(String name) Checks whether a class is registered.static boolean
isClassRegistered
(FabledClass fabledClass) Checks whether a class is registered.static boolean
isClassRegistered
(PlayerClass playerClass) Checks whether a class is registered.static boolean
isLoaded()
Checks whether Fabled has all its data loaded and running.static boolean
isSkillRegistered
(String name) Checks whether a skill is registeredstatic boolean
isSkillRegistered
(PlayerSkill skill) Checks whether a skill is registeredstatic boolean
isSkillRegistered
(Skill skill) Checks whether a skill is registeredvoid
listen
(FabledListener listener, boolean enabled) void
Disables Fabled, saving data before unloading everything and disconnecting listeners.void
onEnable()
Enables Fabled, setting up listeners, managers, and loading data.void
onLoad()
static void
reload()
Reloads the pluginstatic void
removeMeta
(org.bukkit.metadata.Metadatable target, String key) Removes metadata from an entitystatic org.bukkit.scheduler.BukkitTask
Schedules a delayed taskstatic org.bukkit.scheduler.BukkitTask
schedule
(org.bukkit.scheduler.BukkitRunnable runnable, int delay) Schedules a delayed taskstatic org.bukkit.scheduler.BukkitTask
schedule
(org.bukkit.scheduler.BukkitRunnable runnable, int delay, int period) Schedules a repeating taskstatic void
Sets a value to an entity's metadatastatic void
unloadPlayerData
(org.bukkit.OfflinePlayer player, boolean skipSaving) Unloads player data from memory, saving it to the config first and then removing it from the map.Methods inherited from class com.sucy.skill.SkillAPI
getAttributeManager, getPlayerAccountData, getPlayerAccountData, getPlayerData, initFakeData, loadPlayerData, reloadPlayerData, saveData, unloadPlayerData
Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, 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
-
Field Details
-
RANDOM
-
-
Constructor Details
-
Fabled
- Throws:
IOException
-
Fabled
public Fabled(org.bukkit.plugin.java.JavaPluginLoader loader, org.bukkit.plugin.PluginDescriptionFile description, File dataFolder, File file) throws IOException - Throws:
IOException
-
-
Method Details
-
isLoaded
public static boolean isLoaded()Checks whether Fabled has all its data loaded and running.- Returns:
- true if loaded and set up, false otherwise
-
inst
- Returns:
- Fabled singleton if available
- Throws:
FabledNotEnabledException
- if Fabled isn't enabled
-
getSettings
Retrieves the settings data controlling Fabled- Returns:
- Fabled settings data
-
getIO
Retrieves the IO manager for Fabled- Returns:
- Fabled IO manager
-
getLanguage
public static studio.magemonkey.codex.mccore.config.CommentedLanguageConfig getLanguage()Retrieves the language file data for Fabled- Returns:
- Fabled language file data
-
getComboManager
Retrieves the manager for click cast combos- Returns:
- click combo manager
-
getAttributesManager
Retrieves the attribute manager for Fabled- Returns:
- attribute manager
-
getSkill
Retrieves a skill by name. If no skill is found with the name, null is returned instead.- Parameters:
name
- name of the skill- Returns:
- skill with the name or null if not found
-
getSkills
Retrieves the registered skill data for Fabled. It is recommended that you don't edit this map. Instead, use "addSkill" and "addSkills" instead.- Returns:
- the map of registered skills
-
isSkillRegistered
Checks whether a skill is registered- Parameters:
name
- name of the skill- Returns:
- true if registered, false otherwise
-
isSkillRegistered
Checks whether a skill is registered- Parameters:
skill
- the skill to check- Returns:
- true if registered, false otherwise
-
isSkillRegistered
Checks whether a skill is registered- Parameters:
skill
- the skill to check- Returns:
- true if registered, false otherwise
-
getClass
Retrieves a class by name. If no skill is found with the name, null is returned instead.- Parameters:
name
- name of the class- Returns:
- class with the name or null if not found
-
getClasses
Retrieves the registered class data for Fabled. It is recommended that you don't edit this map. Instead, use "addClass" and "addClasses" instead.- Returns:
- the map of registered skills
-
getBaseClasses
Retrieves a list of base classes that don't profess from another class- Returns:
- the list of base classes
-
isClassRegistered
Checks whether a class is registered.- Parameters:
name
- name of the class- Returns:
- true if registered, false otherwise
-
isClassRegistered
Checks whether a class is registered.- Parameters:
playerClass
- the class to check- Returns:
- true if registered, false otherwise
-
isClassRegistered
Checks whether a class is registered.- Parameters:
fabledClass
- the class to check- Returns:
- true if registered, false otherwise
-
getData
Retrieves the active class data for the player. If no data is found for the player, a new set of data will be created and returned.- Parameters:
player
- player to get the data for- Returns:
- the class data of the player
-
hasPlayerData
public static boolean hasPlayerData(org.bukkit.OfflinePlayer player) Checks whether Fabled currently has loaded data for the given player. This returning false doesn't necessarily mean the player doesn't have any data at all, just not data that is currently loaded.- Parameters:
player
- player to check for- Returns:
- true if data has loaded, false otherwise
-
unloadPlayerData
public static void unloadPlayerData(org.bukkit.OfflinePlayer player, boolean skipSaving) Unloads player data from memory, saving it to the config first and then removing it from the map.- Parameters:
player
- player to unload data forskipSaving
- whether to skip saving the data before unloading
-
getPlayerAccounts
Retrieves all class data for the player. This includes the active and all inactive accounts the player has. If no data is found, a new set of data will be created and returned.- Parameters:
player
- player to get the data for- Returns:
- the class data of the player
-
getGroups
Retrieves the list of active class groups used by registered classes- Returns:
- list of active class groups
-
schedule
public static org.bukkit.scheduler.BukkitTask schedule(org.bukkit.scheduler.BukkitRunnable runnable, int delay) Schedules a delayed task- Parameters:
runnable
- the task to scheduledelay
- the delay in ticks
-
schedule
Schedules a delayed task- Parameters:
runnable
- the task to scheduledelay
- the delay in ticks
-
schedule
public static org.bukkit.scheduler.BukkitTask schedule(org.bukkit.scheduler.BukkitRunnable runnable, int delay, int period) Schedules a repeating task- Parameters:
runnable
- the task to scheduledelay
- the delay in ticks before the first tickperiod
- how often to run in ticks
-
setMeta
Sets a value to an entity's metadata- Parameters:
target
- entity to set tokey
- key to store undervalue
- value to store
-
getMeta
Retrieves metadata from an entity- Parameters:
target
- entity to retrieve fromkey
- key the value was stored under- Returns:
- the stored value
-
getMetaInt
Retrieves metadata from an entity- Parameters:
target
- entity to retrieve fromkey
- key the value was stored under- Returns:
- the stored value
-
getMetaDouble
Retrieves metadata from an entity- Parameters:
target
- entity to retrieve fromkey
- key the value was stored under- Returns:
- the stored value
-
removeMeta
Removes metadata from an entity- Parameters:
target
- entity to remove fromkey
- key metadata was stored under
-
getConfig
Grabs a config for Fabled- Parameters:
name
- config file name- Returns:
- config data
-
reload
public static void reload()Reloads the plugin -
onLoad
public void onLoad()- Specified by:
onLoad
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onLoad
in classorg.bukkit.plugin.java.JavaPlugin
-
onDisable
public void onDisable()Disables Fabled, saving data before unloading everything and disconnecting listeners. This should not be called by other plugins.
- Specified by:
onDisable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-
onEnable
public void onEnable()Enables Fabled, setting up listeners, managers, and loading data. This should not be called by other plugins.
- Specified by:
onEnable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
listen
-
addDynamicSkill
This adds a dynamic skill to the skill list. This should not be called by other plugins.- Parameters:
skill
- the dynamic skill to register
-
addSkill
Registers a new skill with Fabled. If this is called outside the method provided in SkillPlugin, this will throw an error. You should implement SkillPlugin in your main class and call this from the provided "registerSkills" method.- Parameters:
skill
- skill to register
-
addSkills
Registers multiple new skills with Fabled. If this is called outside the method provided in SkillPlugin, this will throw an error. You should implement SkillPlugin in your main class and call this from the provided "registerSkills" method.- Parameters:
skills
- skills to register
-
addClass
Registers a new class with Fabled. If this is called outside the method provided in SkillPlugin, this will throw an error. You should implement SkillPlugin in your main class and call this from the provided "registerClasses" method.- Parameters:
fabledClass
- class to register
-
addDynamicClass
Adds a dynamic class which ignores validation. This should only be used by the API as other plugins should use the regular addClass.- Parameters:
rpgClass
- dynamic class to add
-
addClasses
Registers a new class with Fabled. If this is called outside the method provided in SkillPlugin, this will throw an error. You should implement SkillPlugin in your main class and call this from the provided "registerClasses" method.- Parameters:
classes
- classes to register
-
getShieldManager
-