Package studio.magemonkey.fabled.data
Class Settings
java.lang.Object
com.sucy.skill.data.Settings
studio.magemonkey.fabled.data.Settings
The management class for Fabled's config.yml settings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
areSkillsDisabledForRegion
(String region) boolean
canAttack
(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity target) Checks whether something can be attackedboolean
canAttack
(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity target, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) Checks whether something can be attackedGets the text to display on the action bargetAttrGiveText
(String attr) int
getAttrReqText
(String attr) Retrieves the text used for attribute requirements on itemsdouble
getBreakYield
(PlayerClass playerClass, org.bukkit.Material mat) long
org.bukkit.inventory.ItemStack
int
int
Retrieves the amount of seconds allowed between clicks before the combo resetsint
Retrieves the max length of combos to be useddouble
getCraftYield
(PlayerClass playerClass, org.bukkit.Material mat) boolean[]
Retrieves the default skill bar layoutint
Retrieves the default health for players that do not have a class.boolean[]
ArrayList
<org.bukkit.Material> Retrieves the list of filtered blocksGets the setting for using the food barint
Retrieves the frequency of mana gaingetGroupSettings
(String group) Retrieves the settings for a class grouporg.bukkit.inventory.ItemStack
org.bukkit.inventory.ItemStack
Gets the setting for using the level barRetrieves the skill used for level up effectsboolean[]
Retrieves the list of locked skill bar slotsRetrieves the text used for class requirements on itemsRetrieves the text used for excluded classes on itemsRetrieves the text used for level requirements on itemsRetrieves the main class group for displaying prefixes or showing account informationint
Retrieves the max accounts allowed for most playersint
getMaxAccounts
(org.bukkit.entity.Player player) Retrieves the max amount of accounts allowed for a specific player by checking permissions for additional accounts.int
Gets the radius in which skill messages are sent outdouble
getPlaceYield
(PlayerClass playerClass, org.bukkit.Material mat) int
int
int
getRequiredExp
(int level) Gets the required amount of experience at a given levelint
Retrieves the amount of ticks in between each auto savegetSkillText
(String skill) int[]
getSlots()
Retrieves the name of the SQL databaseint
Retrieves the host IP for the databaseRetrieves the password for the database credentialsRetrieves the host port for the databaseRetrieves the username for the database credentialsint
int
int
org.bukkit.inventory.ItemStack
Retrieves the indicator for an unassigned skill slotdouble
Gets the experience yield of a mobboolean
Checks whether the plugin has a valid skill for level up effects loaded.boolean
Checks whether downgrades are allowedboolean
isAlly
(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity target) Checks whether something is an allyboolean
boolean
Checks whether attribute points can be refundedboolean
Checks whether attributes are enabledboolean
Checks whether auto saving is enabledboolean
Checks whether players in creative mode are blocked from receiving experience.boolean
Checks whether experience from mobs spawned via eggs are to be blockedboolean
boolean
Checks whether experience from mobs spawned via a mob spawner is to be blocked.boolean
boolean
boolean
Checks whether lore requirements are enabledboolean
boolean
Checks whether click combos are enabledboolean
Checks whether players can customize their click combosboolean
Whether health less than 10 hearts should be scaled down instead of filling the full 10 hearts.boolean
boolean
isExpDisabledForRegion
(String region) boolean
boolean
boolean
boolean
Checks whether mana is enabledboolean
Checks whether Fabled should modify the max health of playersboolean
Checks whether old health bars (fixed 10 hearts) are enabledboolean
Retrieves whether accounts should be initialized with one file per class.boolean
boolean
boolean
boolean
boolean
Checks whether a player's class level is to be shown below their nameboolean
Checks whether a player's class name is to be shown next to their nameboolean
Checks whether messages should be displayed when a player gains experienceboolean
Checks whether auto-leveled skills are to be shown.boolean
Checks whether messages should be displayed when a player gains a levelboolean
Checks whether messages should be displayed when a loses experienceboolean
Checks whether messages should be displayed when a player loses a levelboolean
Checks whether the stats scoreboard is to be shownboolean
Checks whether skill messages are enabledboolean
Checks whether the skill bar is to display cooldownsboolean
Checks whether the skill bar is enabledboolean
boolean
Checks whether the action bar is being usedboolean
Checks whether experience is to be gained through vanilla experience orbsboolean
isUseSql()
Checks whether the plugin is using SQL Database savingboolean
isValidTarget
(org.bukkit.entity.LivingEntity target) Checks whether a target is a valid target.boolean
isWorldEnabled
(String world) Checks whether Fabled is active in the world with the given name.boolean
isWorldEnabled
(org.bukkit.World world) Checks whether Fabled is active in the worldboolean
void
void
void
reload()
Reloads the settings from Fabled's config.yml file.void
setCombatProtection
(CombatProtection combatProtection) Swaps out the default combat protection for a custom onevoid
setPassiveAlly
(boolean passiveAlly) boolean
boolean
shouldIgnoreExpLoss
(org.bukkit.World world) boolean
boolean
Check whether to use the title display on the given message type
-
Constructor Details
-
Settings
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
-
getPlaceYield
-
getCraftYield
-
loadGroupSettings
public void loadGroupSettings() -
getGroupSettings
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 entitytarget
- 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 entitytarget
- the target entitycause
- 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 -
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
Retrieves the skill used for level up effects- Returns:
- skill for level up effects
-
getSkillText
- Returns:
- lore for skill requirements
-
getAttrReqText
Retrieves the text used for attribute requirements on items- Returns:
- lore text for attributes
-
getAttrGiveText
- Returns:
- lore text for giving attributes
-
useTitle
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
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
Checks whether Fabled is active in the world with the given name.- Parameters:
world
- world name- Returns:
- true if active, false otherwise
-
areSkillsDisabledForRegion
-
isExpDisabledForRegion
-
getScoreboardFormat
-
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
Retrieves the main class group for displaying prefixes or showing account information- Returns:
- main class group
-
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
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
Retrieves the host IP for the database- Returns:
- host IP for SQL database
-
getSqlPort
Retrieves the host port for the database- Returns:
- host port for SQL database
-
getSqlDatabase
Retrieves the name of the SQL database- Returns:
- SQL database name
-
getSqlUser
Retrieves the username for the database credentials- Returns:
- SQL database username
-
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
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
Retrieves the text used for class requirements on items- Returns:
- lore text for class requirements
-
getLoreLevelText
Retrieves the text used for level requirements on items- Returns:
- lore text for level requirements
-
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
Gets the setting for using the level bar- Returns:
- level bar setting
-
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
- 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
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
-
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
-
getCastSlot
public int getCastSlot()- Returns:
- slot the cast item is stored in
-
getCastCooldown
public long getCastCooldown()- Returns:
- global cooldown for casting
-
getMessageFormatSkill
-
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()
-