Class Settings

java.lang.Object
com.sucy.skill.data.Settings

public class Settings extends Object

The management class for SkillAPI's config.yml settings.

  • Constructor Details

    • Settings

      public Settings(SkillAPI plugin)

      Initializes a new settings manager.

      This is already set up by SkillAPI and shouldn't be instantiated elsewhere. Instead, get it from SkillAPI using the SkillAPI.getSettings() method.

      Parameters:
      plugin - SkillAPI plugin reference
  • Method Details

    • reload

      public void reload()

      Reloads the settings from SkillAPI's config.yml file.

      This will fill in any missing values with default values and trim any values that aren't supposed to be there.

    • loadExperienceSettings

      public void loadExperienceSettings()
    • getBreakYield

      public double getBreakYield(PlayerClass playerClass, org.bukkit.Material mat)
    • getPlaceYield

      public double getPlaceYield(PlayerClass playerClass, org.bukkit.Material mat)
    • getCraftYield

      public double getCraftYield(PlayerClass playerClass, org.bukkit.Material mat)
    • loadGroupSettings

      public void loadGroupSettings()
    • getGroupSettings

      public GroupSettings getGroupSettings(String group)
      Retrieves the settings for a class group
      Parameters:
      group - name of the group to retrieve the settings for
      Returns:
      settings for the class group
    • getMaxAccounts

      public int getMaxAccounts(org.bukkit.entity.Player player)
      Retrieves the max amount of accounts allowed for a specific player by checking permissions for additional accounts.
      Parameters:
      player - player to check the max allowed accounts for
      Returns:
      number of allowed accounts
    • canAttack

      public boolean canAttack(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity target)
      Checks whether something can be attacked
      Parameters:
      attacker - the attacking entity
      target - the target entity
      Returns:
      true if can be attacked, false otherwise
    • canAttack

      public boolean canAttack(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity target, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)
      Checks whether something can be attacked
      Parameters:
      attacker - the attacking entity
      target - the target entity
      cause - the cause of the damage, might affect death messages
      Returns:
      true if can be attacked, false otherwise
    • isAlly

      public boolean isAlly(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity target)
      Checks whether something is an ally
      Parameters:
      attacker - the attacking entity
      target - the target entity
      Returns:
      true if an ally, false otherwise
    • isValidTarget

      public boolean isValidTarget(org.bukkit.entity.LivingEntity target)
      Checks whether a target is a valid target.
      Parameters:
      target - target to check
      Returns:
      true if a valid target, false otherwise
    • setCombatProtection

      public void setCombatProtection(CombatProtection combatProtection)
      Swaps out the default combat protection for a custom one
      Parameters:
      combatProtection - combat protection to use
    • isAutoSave

      public boolean isAutoSave()
      Checks whether auto saving is enabled
      Returns:
      true if enabled, false otherwise
    • getSaveFreq

      public int getSaveFreq()
      Retrieves the amount of ticks in between each auto save
      Returns:
      frequency of saves
    • isUseSql

      public boolean isUseSql()
      Checks whether the plugin is using SQL Database saving
      Returns:
      true if enabled, false otherwise
    • getSqlUser

      public String getSqlUser()
      Retrieves the username for the database credentials
      Returns:
      SQL database username
    • getSqlPass

      public String getSqlPass()
      Retrieves the password for the database credentials
      Returns:
      SQL database password
    • getSqlDelay

      public int getSqlDelay()
      Returns:
      time in milliseconds to wait before loading SQL data
    • isModifyHealth

      public boolean isModifyHealth()
      Checks whether SkillAPI should modify the max health of players
      Returns:
      true if enabled, false otherwise
    • getDefaultHealth

      public int getDefaultHealth()

      Retrieves the default health for players that do not have a class.

      Returns:
      default health for classless players
    • isShowingAutoSkills

      public boolean isShowingAutoSkills()
      Checks whether auto-leveled skills are to be shown.
      Returns:
      true if shown, false otherwise
    • isAttributesEnabled

      public boolean isAttributesEnabled()
      Checks whether attributes are enabled
      Returns:
      true if enabled, false otherwise
    • hasLevelUpEffect

      public boolean hasLevelUpEffect()
      Checks whether the plugin has a valid skill for level up effects loaded.
      Returns:
      true if one is available, false otherwise
    • getLevelUpSkill

      public DynamicSkill getLevelUpSkill()
      Retrieves the skill used for level up effects
      Returns:
      skill for level up effects
    • getSkillText

      public String getSkillText(String skill)
      Returns:
      lore for skill requirements
    • getAttrReqText

      public String getAttrReqText(String attr)
      Retrieves the text used for attribute requirements on items
      Returns:
      lore text for attributes
    • getAttrGiveText

      public String getAttrGiveText(String attr)
      Returns:
      lore text for giving attributes
    • useTitle

      public boolean useTitle(TitleType type)
      Check whether to use the title display on the given message type
      Parameters:
      type - type of message to check for
      Returns:
      true if should use title display, false otherwise
    • isUsingBars

      public boolean isUsingBars()
      Returns:
      true if using bar format, false otherwise
    • isUsingWand

      public boolean isUsingWand()
    • isUsingCombat

      public boolean isUsingCombat()
    • getRequiredExp

      public int getRequiredExp(int level)
      Gets the required amount of experience at a given level
      Parameters:
      level - level of the class
      Returns:
      required experience to gain a level
    • getYield

      public double getYield(String mob)
      Gets the experience yield of a mob
      Parameters:
      mob - mob to get the yield of
      Returns:
      experience yield
    • shouldIgnoreExpLoss

      public boolean shouldIgnoreExpLoss(org.bukkit.World world)
      Parameters:
      world - world a player died in
      Returns:
      true if the world is blacklisted for losing experience
    • isWorldEnabled

      public boolean isWorldEnabled(org.bukkit.World world)
      Checks whether SkillAPI is active in the world
      Parameters:
      world - world to check
      Returns:
      true if active, false otherwise
    • isWorldEnabled

      public boolean isWorldEnabled(String world)
      Checks whether SkillAPI is active in the world with the given name.
      Parameters:
      world - world name
      Returns:
      true if active, false otherwise
    • areSkillsDisabledForRegion

      public boolean areSkillsDisabledForRegion(String region)
    • isExpDisabledForRegion

      public boolean isExpDisabledForRegion(String region)