Class PlayerData

java.lang.Object
studio.magemonkey.fabled.api.player.PlayerData

public class PlayerData extends Object
Represents one account for a player which can contain one class from each group and the skills in each of those classes. You should not instantiate this class yourself and instead get it from the Fabled static methods.

In order to get a player's data, use "Fabled.getData(...)". Do NOT try to instantiate your own PlayerData object.

  • Field Details

    • attributes

      public final Map<String,Integer> attributes
      This represents the number of attribute points invested in each attribute
    • attrUpStages

      public final Map<String,Integer> attrUpStages
      This represents the actual attribute level/stage
    • attribPoints

      public int attribPoints
      The current amount of attribute points
  • Method Details

    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Retrieves the Bukkit player object of the owner
      Returns:
      Bukkit player object of the owner or null if offline
    • getPlayerName

      public String getPlayerName()
      Retrieves the name of the owner
      Returns:
      name of the owner
    • getUUID

      public UUID getUUID()
    • getSkillBar

      public PlayerSkillBar getSkillBar()
      Retrieves the skill bar data for the owner
      Returns:
      skill bar data of the owner
    • getCastBars

      public PlayerCastBars getCastBars()
      Returns:
      cast bars data for the player
    • getTextCastingData

      public PlayerTextCastingData getTextCastingData()
      Returns:
      cast bars data for the player
    • subtractHungerValue

      public int subtractHungerValue(double amount)
    • endInit

      public void endInit()
      Ends the initialization flag for the data. Used by the API to avoid async issues. Do not use this in other plugins.
    • getAttributes

      public HashMap<String,Integer> getAttributes()
      Retrieves a map of all player attribute totals. Modifying the map will not change actual player attributes.
      Returns:
      attribute totals
    • getInvestedAttributes

      public HashMap<String,Integer> getInvestedAttributes()
      Retrieves a map of all attributes the player invested. This doesn't count base attributes from classes or bonus attributes from effects. Modifying the map will not change actual player attributes.
      Returns:
      attribute totals
    • getInvestedAttributesStages

      public HashMap<String,Integer> getInvestedAttributesStages()
      Retrieves a map of all attributes upgrade stages. This doesn't count base attributes from classes or bonus attributes from effects. Modifying the map will not change actual player attributes.
      Returns:
      attribute upgrade stages
    • getAttribute

      public int getAttribute(String key)
      Gets the number of attribute points the player has from invested and bonus sources.
      Parameters:
      key - attribute key
      Returns:
      number of total points
    • getInvestedAttribute

      public int getInvestedAttribute(String key)
      Gets the number of attribute points invested in the given attribute
      Parameters:
      key - attribute key
      Returns:
      number of invested points
    • getInvestedAttributeStage

      public int getInvestedAttributeStage(String key)
      Gets the upgrade stage of the given attribute
      Parameters:
      key - attribute key
      Returns:
      the stage of the attribute
    • hasAttribute

      public boolean hasAttribute(String key)
      Checks whether the player has any points invested in a given attribute
      Parameters:
      key - attribute key
      Returns:
      true if any points are invested, false otherwise
    • upAttribute

      public boolean upAttribute(String key)
      Invests a point in the attribute if the player has enough remaining attribute points. If the player has no remaining points, this will do nothing.
      Parameters:
      key - attribute key
      Returns:
      whether it was successfully upgraded
    • getAttributeUpCost

      public int getAttributeUpCost(String key)
      Calculating cost using the formula: costBase + (int) Math.floor(attrStage*costModifier).
      Parameters:
      key - attribute key
      Returns:
      calculated cost of single attribute upgrade
    • getAttributeUpCost

      public int getAttributeUpCost(String key, Integer modifier)
      Calculating cost using the formula: costBase + (int) Math.floor(attrStage*costModifier).

      OVERLOAD to check cost of certain stage: mod = -1 is e.g. of previous stage, mod = 0 is e.g. of current stage, mod = 1 is e.g. default cost of next stage.

      Parameters:
      key - attribute key
      modifier - stage number modifier
      Returns:
      calculated cost of single attribute upgrade
    • getAttributeUpCost

      public int getAttributeUpCost(String key, Integer from, Integer to)
      Calculating cost using the formula: costBase + (int) Math.floor(attrStage*costModifier).

      OVERLOAD to check total cost of upgrading [from] stage --> [to] stage where [from] is starting stage and where [to] is target stage

      Parameters:
      key - attribute key
      from - starting stage
      to - target stage
      Returns:
      calculated cost of single attribute upgrade
    • giveAttribute

      public boolean giveAttribute(String key, int amount)
      Upgrades the player attribute stage without costing attribute points.
      Parameters:
      key - attribute to give points for
      amount - amount to give
    • addStatModifier

      public void addStatModifier(String key, PlayerStatModifier modifier, boolean update)
      Adds stat modifier to the player. These bypass min/max invest amount and cannot be refunded.
      Parameters:
      key - stat key
      modifier - The player stat modifier
      update - calculate player stat immediately and apply to him
    • getStatModifiers

      public List<PlayerStatModifier> getStatModifiers(String key)
      Get all stat modifier from the player.
      Parameters:
      key - stat key
      Returns:
      stat modifier list of the attribute given
    • addAttributeModifier

      public void addAttributeModifier(String key, PlayerAttributeModifier modifier, boolean update)
      Adds attribute modifier to the player. These bypass min/max invest amount and cannot be refunded.
      Parameters:
      key - attribute key
      modifier - The player attribute modifier
      update - calculate player stat immediately and apply to him
    • getAttributeModifiers

      public List<PlayerAttributeModifier> getAttributeModifiers(String key)
      Get all attribute modifier from the player.
      Parameters:
      key - attribute key
      Returns:
      attribute modifier list of the attribute given
    • refundAttributeAll

      public boolean refundAttributeAll(String key)
      Refunds all invested attribute points for the given attribute
      Parameters:
      key - attribute key
      Returns:
      true if successful, false otherwise
    • refundAttribute

      public boolean refundAttribute(String key, int refundAmount)
      Refunds an attribute point from the given attribute if there are any points invested in it. If there are none, this will do nothing.
      Parameters:
      key - attribute key
      refundAmount - the number of points to refund
    • resetAttribute

      public boolean resetAttribute(String key, boolean refund)
      Refunds all spent attribute points for a specific attribute
      Parameters:
      key - attribute key
      refund - whether to refund the points
      Returns:
      true if successful, false otherwise
    • refundAttributes

      public List<String> refundAttributes()
      Refunds all spent attribute points
    • getAttributePoints

      public int getAttributePoints()
      Retrieves the current number of attribute points the player has
      Returns:
      attribute point total
    • giveAttribPoints

      public void giveAttribPoints(int amount)
      Gives the player attribute points
      Parameters:
      amount - amount of attribute points
    • scaleStat

      public double scaleStat(String stat, double baseValue)
      Scales a stat value using the player's attributes
      Parameters:
      stat - stat key
      baseValue - the default value come with vanilla Minecraft, Only needed for custom stats and Speed
      Returns:
      modified value
    • scaleStat

      public double scaleStat(String stat, double defaultValue, double min, double max)
      Scales a stat value using the player's attributes
      Parameters:
      stat - stat key
      defaultValue - the default value come with vanilla Minecraft, Only needed for custom stats and Speed
      min - min value
      max - max value
      Returns:
      modified value
    • scaleDynamic

      public double scaleDynamic(EffectComponent component, String key, double value)
      Scales a dynamic skill's value using global modifiers
      Parameters:
      component - component holding the value
      key - key of the value
      value - unmodified value
      Returns:
      the modified value
    • openAttributeMenu

      public boolean openAttributeMenu()
      Opens the attribute menu for the player
      Returns:
      true if successfully opened, false if conditions weren't met
    • getAttributeData

      public Map<String,Integer> getAttributeData()
      Retrieves the player's attribute data regarding total amounts spent. Modifying this will modify the player's actual data.
      Returns:
      the player's attribute data
    • getAttributeStageData

      public Map<String,Integer> getAttributeStageData()
      Retrieves the player's attribute data regarding current stages. Modifying this will modify the player's actual data.
      Returns:
      the player's attribute data
    • hasSkill

      public boolean hasSkill(String name)
      Checks if the owner has a skill by name. This is not case-sensitive and does not check to see if the skill is unlocked. It only checks if the skill is available to upgrade/use.
      Parameters:
      name - name of the skill
      Returns:
      true if has the skill, false otherwise
    • getSkill

      public PlayerSkill getSkill(String name)
      Retrieves a skill of the owner by name. This is not case-sensitive.
      Parameters:
      name - name of the skill
      Returns:
      data for the skill or null if the player doesn't have the skill
    • getInvestedSkillPoints

      public int getInvestedSkillPoints()
    • getSkills

      public Collection<PlayerSkill> getSkills()
      Retrieves all of the skill data the player has. Modifying this collection will not modify the player's owned skills but modifying one of the elements will change that element's data for the player.
      Returns:
      collection of skill data for the owner
    • getExternallyAddedSkills

      public Set<PlayerData.ExternallyAddedSkill> getExternallyAddedSkills()
    • getSkillLevel

      public int getSkillLevel(String name)
      Retrieves the level of a skill for the owner. This is not case-sensitive.
      Parameters:
      name - name of the skill
      Returns:
      level of the skill or 0 if not found
    • giveSkill

      public void giveSkill(Skill skill)
      Gives the player a skill outside of the normal class skills. This skill will not show up in a skill tree.
      Parameters:
      skill - skill to give the player
    • giveSkill

      public void giveSkill(Skill skill, PlayerClass parent)
      Gives the player a skill using the class data as a parent. This skill will not show up in a skill tree.
      Parameters:
      skill - skill to give the player
      parent - parent class data
    • addSkill

      public void addSkill(Skill skill, PlayerClass parent)
    • addSkillExternally

      public void addSkillExternally(Skill skill, PlayerClass parent, org.bukkit.NamespacedKey namespacedKey, int level)
    • removeSkillExternally

      public void removeSkillExternally(Skill skill, org.bukkit.NamespacedKey namespacedKey)
    • autoLevel

      public void autoLevel()
      Attempts to auto-level any skills that are able to do so
    • upgradeSkill

      public boolean upgradeSkill(Skill skill)
      Upgrades a skill owned by the player. The player must own the skill, have enough skill points, meet the level and skill requirements, and not have maxed out the skill already in order to upgrade the skill. This will consume the skill point cost while upgrading the skill.
      Parameters:
      skill - skill to upgrade
      Returns:
      true if successfully was upgraded, false otherwise
    • forceUpSkill

      public void forceUpSkill(PlayerSkill skill)
      Forcefully upgrades a skill, not letting other plugins cancel it and ignoring any requirements to do so
      Parameters:
      skill - skill to forcefully upgrade
    • forceUpSkill

      public void forceUpSkill(PlayerSkill skill, int amount)
    • downgradeSkill

      public boolean downgradeSkill(Skill skill)
      Downgrades a skill owned by the player. The player must own the skill and it must not currently be level 0 for the player to downgrade the skill. This will refund the skill point cost when downgrading the skill.
      Parameters:
      skill - skill to downgrade
      Returns:
      true if successfully downgraded, false otherwise
    • forceDownSkill

      public void forceDownSkill(PlayerSkill skill)
      Forcefully downgrades a skill, not letting other plugins stop it and ignoring any skill requirements to do so.
      Parameters:
      skill - skill to forcefully downgrade
    • forceDownSkill

      public void forceDownSkill(PlayerSkill skill, int amount)
    • refundSkill

      public void refundSkill(PlayerSkill skill)
      Refunds a skill for the player, resetting it down to level 0 and giving back any invested skill points.
      Parameters:
      skill - skill to refund
    • refundSkills

      public void refundSkills()
      Refunds all skills for the player
    • showSkills

      public void showSkills()
      Shows the skill tree for the player. If the player has multiple trees, this will show the list of skill trees they can view.
    • showDetails

      public boolean showDetails(org.bukkit.entity.Player player)
      Shows the class details for the player
      Parameters:
      player - player to show to
      Returns:
      true if shown, false if nothing to show
    • showProfession

      public boolean showProfession(org.bukkit.entity.Player player)
      Shows profession options of the first class group available
      Parameters:
      player - player to show profession options for
      Returns:
      true if shown profession options, false if none available
    • showSkills

      public boolean showSkills(org.bukkit.entity.Player player)
      Shows the skill tree for the player. If the player has multiple trees, this will show the list of skill trees they can view.
      Parameters:
      player - player to show the skill tree for
      Returns:
      true if able to show the player, false otherwise
    • showSkills

      public boolean showSkills(org.bukkit.entity.Player player, PlayerClass playerClass)
      Shows the skill tree to the player for the given class
      Parameters:
      player - player to show
      playerClass - class to look for
      Returns:
      true if succeeded, false otherwise
    • getShownClassName

      public String getShownClassName()
      Retrieves the name of the class shown in the skill tree
      Returns:
      class name
    • hasClass

      public boolean hasClass()
      Checks whether the player has as least one class they have professed as.
      Returns:
      true if professed, false otherwise
    • hasClass

      public boolean hasClass(String group)
      Checks whether a player has a class within the given group
      Parameters:
      group - class group to check
      Returns:
      true if has a class in the group, false otherwise
    • getClasses

      public Collection<PlayerClass> getClasses()
      Retrieves the collection of the data for classes the player has professed as.
      Returns:
      collection of the data for professed classes
    • getClass

      public PlayerClass getClass(String group)
      Retrieves the data of a class the player professed as by group. This is case-sensitive.
      Parameters:
      group - group to get the profession for
      Returns:
      professed class data or null if not professed for the group
    • getMainClass

      @Nullable public PlayerClass getMainClass()
      Retrieves the data of the professed class under the main class group. The "main" group is determined by the setting in the config.
      Returns:
      main professed class data or null if not professed for the main group
    • setClass

      public PlayerClass setClass(@Nullable FabledClass previous, FabledClass fabledClass, boolean reset)
      Sets the professed class for the player for the corresponding group.
      Parameters:
      previous - the previously professed class, if any
      fabledClass - class to assign to the player
      reset - whether to reset the class data, specifically for changing classes to a class that is not a child of the previous one
      Returns:
      the player-specific data for the new class
    • isExactClass

      public boolean isExactClass(FabledClass fabledClass)
      Checks whether the player is professed as the class without checking child classes.
      Parameters:
      fabledClass - class to check
      Returns:
      true if professed as the specific class, false otherwise
    • isClass

      public boolean isClass(FabledClass fabledClass)
      Checks whether the player is professed as the class or any of its children.
      Parameters:
      fabledClass - class to check
      Returns:
      true if professed as the class or one of its children, false otherwise
    • canProfess

      public boolean canProfess(FabledClass fabledClass)
      Checks whether the player can profess into the given class. This checks to make sure the player is currently professed as the parent of the given class and is high enough of a level to do so.
      Parameters:
      fabledClass - class to check
      Returns:
      true if can profess, false otherwise
    • reset

      public int reset(String group, boolean toSubclass)
      Resets the class data for the owner under the given group. This will remove the profession entirely, leaving no remaining data until the player professes again to a starting class.
      Parameters:
      group - group to reset
      toSubclass - - whether we are professing to a subclass of the previous class
      Returns:
      the number of skill points to be refunded
    • resetAll

      public void resetAll()
      Resets all profession data for the player. This clears all professions the player has, leaving no remaining data until the player professes again to a starting class.
    • resetAttribs

      public void resetAttribs(boolean refund)
      Resets attributes for the player. If refunds are cancelled for any specific attribute, that attribute will not be reset.
      Parameters:
      refund - whether to refund the points for the reset attributes
    • profess

      public boolean profess(FabledClass fabledClass)
      Professes the player into the class if they are able to. This will reset the class data if the group options are set to reset upon profession. Otherwise, all skills, experience, and levels of the current class under the group will be retained and carried over into the new profession.
      Parameters:
      fabledClass - class to profess into
      Returns:
      true if successfully professed, false otherwise
    • giveExp

      public void giveExp(double amount, ExpSource source)
      Gives experience to the player from the given source
      Parameters:
      amount - amount of experience to give
      source - source of the experience
    • giveExp

      public void giveExp(double amount, ExpSource source, boolean message)
      Gives experience to the player from the given source
      Parameters:
      amount - amount of experience to give
      source - source of the experience
      message - whether to show the configured message if enabled
    • loseExp

      public void loseExp(double amount, boolean percent, boolean changeLevel, boolean showMessage)
      Causes the player to lose experience This will launch a PlayerExperienceLostEvent event before taking the experience.
      Parameters:
      amount - percent of experience to lose
      percent - whether to take the amount as a percentage
      changeLevel - whether to change the level of the player
      showMessage - whether to show the configured message if enabled
    • loseExp

      public void loseExp()
      Causes the player to lose experience as a penalty (generally for dying)
    • setExp

      public void setExp(double amount, ExpSource expSource, boolean showMessage)
    • giveLevels

      public boolean giveLevels(int amount, ExpSource source)
      Gives levels to the player for all classes matching the experience source
      Parameters:
      amount - amount of levels to give
      source - source of the levels
    • loseLevels

      public void loseLevels(int amount)
      Causes the player to lose levels
    • setLevel

      public boolean setLevel(int amount, ExpSource source)
    • getPoints

      public int getPoints()
    • givePoints

      @Deprecated public void givePoints(int amount, ExpSource source)
      Deprecated.
      Gives skill points to the player for all classes matching the experience source
      Parameters:
      amount - amount of levels to give
      source - source of the levels
    • givePoints

      public void givePoints(int amount, PointSource source)
      Gives skill points to the player for all classes matching the experience source
      Parameters:
      amount - amount of levels to give
      source - source of the levels
    • setPoints

      public void setPoints(int amount)
      Sets the skill point amount to the player for all classes
      Parameters:
      amount - amount of levels to set to
    • updatePlayerStat

      public void updatePlayerStat(org.bukkit.entity.Player player)
      Updates all the stats of a player based on their current attributes This method is very heavy, consume resources and notable by player Checkout other method such as updateWalkSpeed(Player) for a light refresh
      This also does not update the player equipment You will need to call PlayerEquips.update(Player) before this function to update attribute/stats that comes with equipments
    • updateWalkSpeed

      public void updateWalkSpeed(org.bukkit.entity.Player player)
      Updates walk speed of a player based on their current attributes and apply
      Parameters:
      player - the player
    • updateHealth

      public void updateHealth(org.bukkit.entity.Player player)
      Updates health of a player based on their current attributes and apply
      Parameters:
      player - the player
    • regenMana

      public void regenMana()
      Regenerates mana for the player based on the regen amounts of professed classes
    • giveMana

      public void giveMana(double amount)
      Gives mana to the player from an unknown source. This will not cause the player's mana to go above their max amount.
      Parameters:
      amount - amount of mana to give
    • giveMana

      public void giveMana(double amount, ManaSource source)
      Gives mana to the player from the given mana source. This will not cause the player's mana to go above the max amount.
      Parameters:
      amount - amount of mana to give
      source - source of the mana
    • useMana

      public void useMana(double amount)
      Takes mana away from the player for an unknown reason. This will not cause the player to fall below 0 mana.
      Parameters:
      amount - amount of mana to take away
    • useMana

      public void useMana(double amount, ManaCost cost)
      Takes mana away from the player for the specified reason. This will not cause the player to fall below 0 mana.
      Parameters:
      amount - amount of mana to take away
      cost - source of the mana cost
    • removeStatModifier

      public void removeStatModifier(UUID uuid, boolean update)
      Remove stat modifier with the exact uuid
      Parameters:
      uuid - The uuid
      update - calculate player stat immediately and apply to him
    • clearStatModifier

      public void clearStatModifier()
      Clear all stat modifier which is not persistent
    • removeAttributeModifier

      public void removeAttributeModifier(UUID uuid, boolean update)
      Remove attribute modifier with the exact uuid
      Parameters:
      uuid - The uuid
      update - calculate player stat immediately and apply to him
    • clearAttributeModifiers

      public void clearAttributeModifiers()
      Clear all attribute modifier which is not persistent
    • clearAllModifiers

      public void clearAllModifiers()
      Clear all of the modifiers including stat modifier and attribute modifier
    • getBoundSkill

      @Deprecated public PlayerSkill getBoundSkill(org.bukkit.Material mat)
      Deprecated.
      Retrieves a skill the player has bound by material
      Parameters:
      mat - material to get the bind for
      Returns:
      skill bound to the material or null if none are bound
    • getBinds

      @Deprecated public HashMap<org.bukkit.Material,PlayerSkill> getBinds()
      Deprecated.
      Retrieves the bound data for the player. Modifying this map will modify the bindings the player has.
      Returns:
      the skill binds data for the player
    • isBound

      @Deprecated public boolean isBound(org.bukkit.Material mat)
      Deprecated.
      Checks whether the material has a skill bound to it
      Parameters:
      mat - material to check
      Returns:
      true if a skill is bound to it, false otherwise
    • bind

      @Deprecated public boolean bind(org.bukkit.Material mat, PlayerSkill skill)
      Deprecated.
      Binds a skill to a material for the player. The bind will not work if the skill was already bound to the material.
      Parameters:
      mat - material to bind the skill to
      skill - skill to bind to the material
      Returns:
      true if was able to bind the skill, false otherwise
    • clearBind

      @Deprecated public boolean clearBind(org.bukkit.Material mat)
      Deprecated.
      Clears a skill binding on the material. If there is no binding on the material, this will do nothing.
      Parameters:
      mat - material to clear bindings from
      Returns:
      true if a binding was cleared, false otherwise
    • getPersistentData

      public Object getPersistentData(String key)
      Decrypt and return the saved values on the account.
      Parameters:
      key - The key is used to save the value.
      Returns:
      Decrypted value
    • setPersistentData

      public void setPersistentData(String key, Object data)
      Encrypt and save values to account for long-term storage
      Parameters:
      key - The key is used to save the value.
      data - The value is stored. Currently supported types are: Number, String, Player, TempEntity, Entity
    • removePersistentData

      public void removePersistentData(String key)
      Remove a value with a specific key
      Parameters:
      key - The key is used to save the value.
    • getAllPersistentData

      public Map<String,String> getAllPersistentData()
      Returns:
      original HashMap used to store persistent data
    • clearBinds

      @Deprecated public void clearBinds(Skill skill)
      Deprecated.
      Clears the skill binding for the given skill. This will remove the bindings on all materials involving the skill.
      Parameters:
      skill - skill to unbind
    • clearAllBinds

      @Deprecated public void clearAllBinds()
      Deprecated.
      Clears all binds the player currently has
    • record

      public void record(org.bukkit.entity.Player player)
      Records any data to save with class data
      Parameters:
      player - player to record for
    • updateScoreboard

      public void updateScoreboard()
      Updates the scoreboard with the player's current class. This is already done by the API and doesn't need to be done by other plugins.
    • startPassives

      public void startPassives(org.bukkit.entity.Player player)
      Starts passive abilities for the player if they are online. This is already called by the API and shouldn't be called by other plugins.
      Parameters:
      player - player to set the passive skills up for
    • stopSkills

      public void stopSkills(org.bukkit.entity.Player player)
      Stops passive abilities and events from triggering for the player if they are online. This is already called by the API and shouldn't be called by other plugins.
      Parameters:
      player - player to stop the passive skills for
    • cast

      public boolean cast(String skillName)
      Casts a skill by name for the player. In order to cast the skill, the player must be online, have the skill unlocked, have enough mana, have the skill off cooldown, and have a proper target if applicable.
      Parameters:
      skillName - name of the skill ot cast
      Returns:
      true if successfully cast the skill, false otherwise
    • cast

      public boolean cast(PlayerSkill skill)
      Casts a skill for the player. In order to cast the skill, the player must be online, have the skill unlocked, have enough mana, have the skill off cooldown, and have a proper target if applicable.
      Parameters:
      skill - skill to cast
      Returns:
      true if successfully cast the skill, false otherwise
    • check

      public boolean check(PlayerSkill skill, boolean cooldown, boolean mana)
      Checks the cooldown and mana requirements for a skill
      Parameters:
      skill - skill to check for
      cooldown - whether to check cooldowns
      mana - whether to check mana requirements
      Returns:
      true if can use
    • setOnPreviewStop

      public void setOnPreviewStop(@Nullable Runnable onPreviewStop)
      Stops the current preview, if any, and registers the on-stop runnable for a new preview, if any
      Parameters:
      onPreviewStop - runnable to execute when the new preview stops
    • init

      public void init(org.bukkit.entity.Player player)
      Initializes the application of the data for the player
      Parameters:
      player - player to set up for
    • hasMana

      public boolean hasMana(double amount)
      Checks whether the player has at least the specified amount of mana
      Parameters:
      amount - required mana amount
      Returns:
      true if has the amount of mana, false otherwise
    • getAttrUpStages

      public Map<String,Integer> getAttrUpStages()
      This represents the actual attribute level/stage
    • getExtSkills

      public Set<PlayerData.ExternallyAddedSkill> getExtSkills()
    • getAttributesModifiers

      public Map<String,List<PlayerAttributeModifier>> getAttributesModifiers()
    • getStatModifiers

      public Map<String,List<PlayerStatModifier>> getStatModifiers()
    • getPersistentData

      public Map<String,String> getPersistentData()
    • getCooldownCache

      public Map<String,Long> getCooldownCache()
    • getExtraData

      public studio.magemonkey.codex.mccore.config.parse.DataSection getExtraData()
      Returns:
      extra data attached to the player's account
    • getPlayerUUID

      public UUID getPlayerUUID()
    • getComboData

      public PlayerCombos getComboData()
      The data for the player's combos
      Returns:
      combo data for the player
    • getEquips

      public PlayerEquips getEquips()
      Returns:
      equipped item data
    • getOnCooldown

      public List<UUID> getOnCooldown()
    • getAttribPoints

      public int getAttribPoints()
      The current amount of attribute points
    • getScheme

      public String getScheme()
      Retrieves the name of the active map menu scheme for the player
      Returns:
      map menu scheme name
    • getMenuClass

      public String getMenuClass()
    • getMana

      public double getMana()
      Retrieves the amount of mana the player currently has
      Returns:
      current player mana
    • getMaxMana

      public double getMaxMana()
      Retrieves the max amount of mana the player can have including bonus mana
      Returns:
      max amount of mana the player can have
    • getLastHealth

      public double getLastHealth()
      Returns:
      health during last logout
    • getMaxHealth

      public double getMaxHealth()
    • getHungerValue

      public double getHungerValue()
      The hunger value here is not representative of the player's total hunger, rather the amount left of the next hunger point. This is manipulated by attributes were if an attribute says a player has twice as much "hunger" as normal, this will go down by decimals to slow the decay of hunger.
      Returns:
      amount of the next hunger point the player has
    • isInit

      public boolean isInit()
    • isPassive

      public boolean isPassive()
    • getSkillTimer

      public long getSkillTimer()
    • getRemoveTimer

      public org.bukkit.scheduler.BukkitTask getRemoveTimer()
    • getOnPreviewStop

      public Runnable getOnPreviewStop()
    • setAttribPoints

      public void setAttribPoints(int attribPoints)
      The current amount of attribute points
      Parameters:
      attribPoints - amount of points to have
    • setScheme

      public void setScheme(String scheme)
      Sets the active scheme name for the player
      Parameters:
      scheme - name of the scheme
    • setMana

      public void setMana(double mana)
      Sets the player's amount of mana without launching events
      Parameters:
      mana - current mana
    • setLastHealth

      public void setLastHealth(double lastHealth)
      Used by the API for restoring health - do not use this.
      Parameters:
      lastHealth - health logged off with
    • setHungerValue

      public void setHungerValue(double hungerValue)
      Parameters:
      hungerValue - new hunger value