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

public class Fabled extends SkillAPI

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 Details

    • RANDOM

      public static Random RANDOM
  • Constructor Details

  • 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

      public static Fabled inst()
      Returns:
      Fabled singleton if available
      Throws:
      FabledNotEnabledException - if Fabled isn't enabled
    • getSettings

      public static Settings getSettings()
      Retrieves the settings data controlling Fabled
      Returns:
      Fabled settings data
    • getIO

      public static IOManager 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

      public static ComboManager getComboManager()
      Retrieves the manager for click cast combos
      Returns:
      click combo manager
    • getAttributesManager

      public static IAttributeManager getAttributesManager()
      Retrieves the attribute manager for Fabled
      Returns:
      attribute manager
    • getSkill

      public static Skill getSkill(String name)
      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

      public static Map<String,Skill> 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

      public static boolean isSkillRegistered(String name)
      Checks whether a skill is registered
      Parameters:
      name - name of the skill
      Returns:
      true if registered, false otherwise
    • isSkillRegistered

      public static boolean isSkillRegistered(PlayerSkill skill)
      Checks whether a skill is registered
      Parameters:
      skill - the skill to check
      Returns:
      true if registered, false otherwise
    • isSkillRegistered

      public static boolean isSkillRegistered(Skill skill)
      Checks whether a skill is registered
      Parameters:
      skill - the skill to check
      Returns:
      true if registered, false otherwise
    • getClass

      public static FabledClass getClass(String name)
      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

      public static Map<String,FabledClass> 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

      public static List<FabledClass> getBaseClasses(String group)
      Retrieves a list of base classes that don't profess from another class
      Returns:
      the list of base classes
    • isClassRegistered

      public static boolean isClassRegistered(String name)
      Checks whether a class is registered.
      Parameters:
      name - name of the class
      Returns:
      true if registered, false otherwise
    • isClassRegistered

      public static boolean isClassRegistered(PlayerClass playerClass)
      Checks whether a class is registered.
      Parameters:
      playerClass - the class to check
      Returns:
      true if registered, false otherwise
    • isClassRegistered

      public static boolean isClassRegistered(FabledClass fabledClass)
      Checks whether a class is registered.
      Parameters:
      fabledClass - the class to check
      Returns:
      true if registered, false otherwise
    • getData

      public static PlayerData getData(org.bukkit.OfflinePlayer player)
      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 for
      skipSaving - whether to skip saving the data before unloading
    • getPlayerAccounts

      public static PlayerAccounts getPlayerAccounts(org.bukkit.OfflinePlayer player)
      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

      public static List<String> 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 schedule
      delay - the delay in ticks
    • schedule

      public static org.bukkit.scheduler.BukkitTask schedule(Runnable runnable, int delay)
      Schedules a delayed task
      Parameters:
      runnable - the task to schedule
      delay - 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 schedule
      delay - the delay in ticks before the first tick
      period - how often to run in ticks
    • setMeta

      public static void setMeta(org.bukkit.metadata.Metadatable target, String key, Object value)
      Sets a value to an entity's metadata
      Parameters:
      target - entity to set to
      key - key to store under
      value - value to store
    • getMeta

      public static Object getMeta(org.bukkit.metadata.Metadatable target, String key)
      Retrieves metadata from an entity
      Parameters:
      target - entity to retrieve from
      key - key the value was stored under
      Returns:
      the stored value
    • getMetaInt

      public static int getMetaInt(org.bukkit.metadata.Metadatable target, String key)
      Retrieves metadata from an entity
      Parameters:
      target - entity to retrieve from
      key - key the value was stored under
      Returns:
      the stored value
    • getMetaDouble

      public static double getMetaDouble(org.bukkit.metadata.Metadatable target, String key)
      Retrieves metadata from an entity
      Parameters:
      target - entity to retrieve from
      key - key the value was stored under
      Returns:
      the stored value
    • removeMeta

      public static void removeMeta(org.bukkit.metadata.Metadatable target, String key)
      Removes metadata from an entity
      Parameters:
      target - entity to remove from
      key - key metadata was stored under
    • getConfig

      public static studio.magemonkey.codex.mccore.config.CommentedConfig getConfig(String name)
      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 interface org.bukkit.plugin.Plugin
      Overrides:
      onLoad in class org.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 interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.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 interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class org.bukkit.plugin.java.JavaPlugin
    • listen

      public void listen(FabledListener listener, boolean enabled)
    • addDynamicSkill

      public void addDynamicSkill(DynamicSkill skill)
      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

      public void addSkill(Skill skill)
      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

      public void addSkills(Skill... skills)
      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

      public void addClass(FabledClass fabledClass)
      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

      public void addDynamicClass(DynamicClass rpgClass)
      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

      public void addClasses(FabledClass... classes)
      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

      public ShieldManager getShieldManager()