Class Settings

java.lang.Object
com.sucy.skill.data.Settings
studio.magemonkey.fabled.data.Settings

public class Settings extends Settings

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

  • Constructor Details

    • Settings

      public Settings(Fabled plugin)

      Initializes a new settings manager.

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

      Parameters:
      plugin - Fabled plugin reference
  • Method Details

    • reload

      public void reload()

      Reloads the settings from Fabled'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 the target 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
      Overrides:
      isAlly in class Settings
      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
    • 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
    • isShowingAutoSkills

      public boolean isShowingAutoSkills()
      Checks whether auto-leveled skills are to be shown.
      Returns:
      true if shown, 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
    • getCastItem

      public org.bukkit.inventory.ItemStack getCastItem()
    • getHoverItem

      public org.bukkit.inventory.ItemStack getHoverItem()
    • getInstantItem

      public org.bukkit.inventory.ItemStack getInstantItem()
    • 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 Fabled is active in the world
      Parameters:
      world - world to check
      Returns:
      true if active, false otherwise
    • isWorldEnabled

      public boolean isWorldEnabled(String world)
      Checks whether Fabled 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)
    • getScoreboardFormat

      public List<String> getScoreboardFormat()
    • getScoreboardTitle

      public String getScoreboardTitle()
    • getDefaultBarLayout

      public boolean[] getDefaultBarLayout()
      Retrieves the default skill bar layout
      Returns:
      default skill bar layout
    • getLockedSlots

      public boolean[] getLockedSlots()
      Retrieves the list of locked skill bar slots
      Returns:
      list of locked skill bar slots
    • useBoundingBoxes

      public boolean useBoundingBoxes()
    • isTrackBreak

      public boolean isTrackBreak()
    • isYieldsEnabled

      public boolean isYieldsEnabled()
    • isOnePerClass

      public boolean isOnePerClass()
      Retrieves whether accounts should be initialized with one file per class.
      Returns:
      true if enabled, false otherwise
    • getMainGroup

      public String getMainGroup()
      Retrieves the main class group for displaying prefixes or showing account information
      Returns:
      main class group
    • isSharedSkillPoints

      public boolean isSharedSkillPoints()
    • getMaxAccounts

      public int getMaxAccounts()
      Retrieves the max accounts allowed for most players
      Returns:
      max accounts allowed for most players
    • isPassiveAlly

      public boolean isPassiveAlly()
    • setPassiveAlly

      public void setPassiveAlly(boolean passiveAlly)
    • setCombatProtection

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

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

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

      public String getSqlHost()
      Retrieves the host IP for the database
      Returns:
      host IP for SQL database
    • getSqlPort

      public String getSqlPort()
      Retrieves the host port for the database
      Returns:
      host port for SQL database
    • getSqlDatabase

      public String getSqlDatabase()
      Retrieves the name of the SQL database
      Returns:
      SQL database name
    • 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
    • isModifyHealth

      public boolean isModifyHealth()
      Checks whether Fabled 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
    • isAttributesEnabled

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

      public boolean isAttributesDowngrade()
      Checks whether attribute points can be refunded
      Returns:
      if true, can refund, false otherwise
    • getAttributesDowngradePrice

      public int getAttributesDowngradePrice()
    • isManaEnabled

      public boolean isManaEnabled()
      Checks whether mana is enabled
      Returns:
      true if enabled, false otherwise
    • getGainFreq

      public int getGainFreq()
      Retrieves the frequency of mana gain
      Returns:
      the frequency of mana gain
    • getFilteredBlocks

      public ArrayList<org.bukkit.Material> getFilteredBlocks()
      Retrieves the list of filtered blocks
      Returns:
      list of blocks
    • isAllowDowngrade

      public boolean isAllowDowngrade()
      Checks whether downgrades are allowed
      Returns:
      true if allowed, false otherwise
    • isShowSkillMessages

      public boolean isShowSkillMessages()
      Checks whether skill messages are enabled
      Returns:
      true if enabled, false otherwise
    • isKnockback

      public boolean isKnockback()
      Returns:
      whether knockback should be applied when dealing 0 damage
    • getMessageRadius

      public int getMessageRadius()
      Gets the radius in which skill messages are sent out
      Returns:
      skill message radius
    • isCheckLore

      public boolean isCheckLore()
      Checks whether lore requirements are enabled
      Returns:
      true if enabled, false otherwise
    • isCheckAttributes

      public boolean isCheckAttributes()
      Returns:
      true if should check for attribute bonuses
    • isCheckSkills

      public boolean isCheckSkills()
      Returns:
      true if should check for skill requirements
    • isDropWeapon

      public boolean isDropWeapon()
      Returns:
      checks if weapons are dropped when hovered
    • getLoreClassText

      public String getLoreClassText()
      Retrieves the text used for class requirements on items
      Returns:
      lore text for class requirements
    • getLoreLevelText

      public String getLoreLevelText()
      Retrieves the text used for level requirements on items
      Returns:
      lore text for level requirements
    • getLoreExcludeText

      public String getLoreExcludeText()
      Retrieves the text used for excluded classes on items
      Returns:
      lore text for excluded classes
    • getSlots

      public int[] getSlots()
      Returns:
      slots checked for requirements and attributes
    • isOldHealth

      public boolean isOldHealth()
      Checks whether old health bars (fixed 10 hearts) are enabled
      Returns:
      true if enabled, false otherwise
    • isDownScaling

      public boolean isDownScaling()
      Whether health less than 10 hearts should be scaled down instead of filling the full 10 hearts.
      Returns:
      true if hearts should be allowed to be less than 10
    • isForceScaling

      public boolean isForceScaling()
      Returns:
      true if forces the Fabled health scaling, false otherwise
    • getLevelBar

      public String getLevelBar()
      Gets the setting for using the level bar
      Returns:
      level bar setting
    • getFoodBar

      public String getFoodBar()
      Gets the setting for using the food bar
      Returns:
      food bar setting
    • isBlockSaturation

      public boolean isBlockSaturation()
    • isRefundOnClassChange

      public boolean isRefundOnClassChange()
      Returns:
      boolean whether classes should be refunded their skill points on changing.
    • getLevelText

      public String getLevelText()
      Returns:
      text shown alongside the class level
    • isUseActionBar

      public boolean isUseActionBar()
      Checks whether the action bar is being used
      Returns:
      true if used, false otherwise
    • getActionText

      public String getActionText()
      Gets the text to display on the action bar
      Returns:
      action bar text
    • isShowScoreboard

      public boolean isShowScoreboard()
      Checks whether the stats scoreboard is to be shown
      Returns:
      true if shown, false otherwise
    • isShowClassName

      public boolean isShowClassName()
      Checks whether a player's class name is to be shown next to their name
      Returns:
      true if shown, false otherwise
    • isShowClassLevel

      public boolean isShowClassLevel()
      Checks whether a player's class level is to be shown below their name
      Returns:
      true if shown, false otherwise
    • isShowBinds

      public boolean isShowBinds()
    • getBindText

      public String getBindText()
    • getTitleDuration

      public int getTitleDuration()
      Returns:
      duration of the title display in ticks
    • getTitleFadeIn

      public int getTitleFadeIn()
      Returns:
      fade in time of the title display in ticks
    • getTitleFadeOut

      public int getTitleFadeOut()
      Returns:
      fade out time of the title display in ticks
    • getPvpLevelRange

      public int getPvpLevelRange()
      Returns:
      the maximum level difference two players must have to be able to PVP, or -1 if disabled
    • getPvpMinLevel

      public int getPvpMinLevel()
      Returns:
      the minimum level the player must be to be able to PVP with other players, or -1 if disabled
    • isCastEnabled

      public boolean isCastEnabled()
      Returns:
      true if default casting is enabled
    • getCastMode

      public CastMode getCastMode()
    • getCastSlot

      public int getCastSlot()
      Returns:
      slot the cast item is stored in
    • getCastCooldown

      public long getCastCooldown()
      Returns:
      global cooldown for casting
    • getMessageFormatSkill

      public String getMessageFormatSkill()
    • getMessageFormatSeparator

      public String getMessageFormatSeparator()
    • getEnabledClicks

      public boolean[] getEnabledClicks()
      Returns:
      enabled clicks as an array of booleans indexed by click ID
    • isCombosEnabled

      public boolean isCombosEnabled()
      Checks whether click combos are enabled
      Returns:
      true if enabled, false otherwise
    • isCustomCombosAllowed

      public boolean isCustomCombosAllowed()
      Checks whether players can customize their click combos
      Returns:
      true if can customize them, false otherwise
    • shouldAutoAssignCombos

      public boolean shouldAutoAssignCombos()
    • getComboSize

      public int getComboSize()
      Retrieves the max length of combos to be used
      Returns:
      max length of combos to be used
    • getClickTime

      public int getClickTime()
      Retrieves the amount of seconds allowed between clicks before the combo resets
      Returns:
      number of seconds before a click combo resets
    • isUseOrbs

      public boolean isUseOrbs()
      Checks whether experience is to be gained through vanilla experience orbs
      Returns:
      true if enabled, false otherwise
    • isBlockSpawner

      public boolean isBlockSpawner()
      Checks whether experience from mobs spawned via a mob spawner is to be blocked.
      Returns:
      true if blocked, false otherwise
    • isBlockEgg

      public boolean isBlockEgg()
      Checks whether experience from mobs spawned via eggs are to be blocked
      Returns:
      true if blocked, false otherwise
    • isBlockCreative

      public boolean isBlockCreative()
      Checks whether players in creative mode are blocked from receiving experience.
      Returns:
      true if blocked, false otherwise
    • isShowExpMessages

      public boolean isShowExpMessages()
      Checks whether messages should be displayed when a player gains experience
      Returns:
      true if enabled, false otherwise
    • isShowLevelMessages

      public boolean isShowLevelMessages()
      Checks whether messages should be displayed when a player gains a level
      Returns:
      true if enabled, false otherwise
    • isShowLossExpMessages

      public boolean isShowLossExpMessages()
      Checks whether messages should be displayed when a loses experience
      Returns:
      true if enabled, false otherwise
    • isShowLossLevelMessages

      public boolean isShowLossLevelMessages()
      Checks whether messages should be displayed when a player loses a level
    • isSkillBarEnabled

      public boolean isSkillBarEnabled()
      Checks whether the skill bar is enabled
      Returns:
      true if enabled, false otherwise
    • isSkillBarCooldowns

      public boolean isSkillBarCooldowns()
      Checks whether the skill bar is to display cooldowns
      Returns:
      true if enabled, false otherwise
    • getUnassigned

      public org.bukkit.inventory.ItemStack getUnassigned()
      Retrieves the indicator for an unassigned skill slot
      Returns:
      unassigned indicator
    • isInteractRightClick

      public boolean isInteractRightClick()
    • isAnimationLeftClick

      public boolean isAnimationLeftClick()