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 TypeMethodDescriptionvoidaddClass(FabledClass fabledClass) Registers a new class with Fabled.voidaddClasses(FabledClass... classes) Registers a new class with Fabled.voidaddDynamicClass(DynamicClass rpgClass) Adds a dynamic class which ignores validation.voidaddDynamicSkill(DynamicSkill skill) This adds a dynamic skill to the skill list.voidRegisters a new skill with Fabled.voidRegisters multiple new skills with Fabled.static IAttributeManagerRetrieves the attribute manager for Fabledstatic List<FabledClass> getBaseClasses(String group) Retrieves a list of base classes that don't profess from another classstatic FabledClassRetrieves a class by name.static Map<String, FabledClass> Retrieves the registered class data for Fabled.static ComboManagerRetrieves the manager for click cast combosstatic studio.magemonkey.codex.mccore.config.CommentedConfigGrabs a config for Fabledstatic PlayerDatagetData(org.bukkit.OfflinePlayer player) Retrieves the active class data for the player.Retrieves the list of active class groups used by registered classesstatic IOManagergetIO()Retrieves the IO manager for Fabledstatic studio.magemonkey.codex.mccore.config.CommentedLanguageConfigRetrieves the language file data for Fabledstatic ObjectRetrieves metadata from an entitystatic doublegetMetaDouble(org.bukkit.metadata.Metadatable target, String key) Retrieves metadata from an entitystatic intgetMetaInt(org.bukkit.metadata.Metadatable target, String key) Retrieves metadata from an entitystatic PlayerAccountsgetPlayerAccounts(org.bukkit.OfflinePlayer player) Retrieves all class data for the player.static SettingsRetrieves the settings data controlling Fabledstatic SkillRetrieves a skill by name.Retrieves the registered skill data for Fabled.static booleanhasPlayerData(org.bukkit.OfflinePlayer player) Checks whether Fabled currently has loaded data for the given player.static Fabledinst()static booleanisClassRegistered(String name) Checks whether a class is registered.static booleanisClassRegistered(FabledClass fabledClass) Checks whether a class is registered.static booleanisClassRegistered(PlayerClass playerClass) Checks whether a class is registered.static booleanisLoaded()Checks whether Fabled has all its data loaded and running.static booleanisSkillRegistered(String name) Checks whether a skill is registeredstatic booleanisSkillRegistered(PlayerSkill skill) Checks whether a skill is registeredstatic booleanisSkillRegistered(Skill skill) Checks whether a skill is registeredvoidlisten(FabledListener listener, boolean enabled) voidDisables Fabled, saving data before unloading everything and disconnecting listeners.voidonEnable()Enables Fabled, setting up listeners, managers, and loading data.voidonLoad()static voidreload()Reloads the pluginstatic voidremoveMeta(org.bukkit.metadata.Metadatable target, String key) Removes metadata from an entitystatic org.bukkit.scheduler.BukkitTaskSchedules a delayed taskstatic org.bukkit.scheduler.BukkitTaskschedule(org.bukkit.scheduler.BukkitRunnable runnable, int delay) Schedules a delayed taskstatic org.bukkit.scheduler.BukkitTaskschedule(org.bukkit.scheduler.BukkitRunnable runnable, int delay, int period) Schedules a repeating taskstatic voidSets a value to an entity's metadatastatic voidunloadPlayerData(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, unloadPlayerDataMethods 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, toStringMethods 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:
onLoadin interfaceorg.bukkit.plugin.Plugin- Overrides:
onLoadin 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:
onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein 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:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein 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
-