mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-02-19 02:12:58 +01:00
formatting applied to most of the source code to tidy things up, and misc refactors
This commit is contained in:
@@ -4,11 +4,10 @@ import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
|
||||
public class AdvancedConfig extends BukkitConfig {
|
||||
int[] defaultCrippleValues = new int[]{10, 15, 20, 25};
|
||||
@@ -66,7 +65,8 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
if (getCatalysisMaxSpeed() < getCatalysisMinSpeed()) {
|
||||
reason.add("Skills.Alchemy.Catalysis.MaxSpeed should be at least Skills.Alchemy.Catalysis.MinSpeed!");
|
||||
reason.add(
|
||||
"Skills.Alchemy.Catalysis.MaxSpeed should be at least Skills.Alchemy.Catalysis.MinSpeed!");
|
||||
}
|
||||
|
||||
/* ARCHERY */
|
||||
@@ -358,7 +358,8 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
if (getMaxHorseJumpStrength() < 0 || getMaxHorseJumpStrength() > 2) {
|
||||
reason.add("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength should be between 0 and 2!");
|
||||
reason.add(
|
||||
"Skills.Taming.CallOfTheWild.MaxHorseJumpStrength should be between 0 and 2!");
|
||||
}
|
||||
|
||||
/* UNARMED */
|
||||
@@ -410,7 +411,8 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
/* GENERAL */
|
||||
|
||||
public boolean useAttackCooldown() {
|
||||
return config.getBoolean("Skills.General.Attack_Cooldown.Adjust_Skills_For_Attack_Cooldown", true);
|
||||
return config.getBoolean("Skills.General.Attack_Cooldown.Adjust_Skills_For_Attack_Cooldown",
|
||||
true);
|
||||
}
|
||||
|
||||
public boolean canApplyLimitBreakPVE() {
|
||||
@@ -426,29 +428,32 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level.
|
||||
* It returns a different value depending on whether the server is in retro mode
|
||||
* This returns the maximum level at which superabilities will stop lengthening from scaling
|
||||
* alongside skill level. It returns a different value depending on whether the server is in
|
||||
* retro mode
|
||||
*
|
||||
* @return the level at which abilities stop increasing in length
|
||||
*/
|
||||
public int getAbilityLengthCap() {
|
||||
if (!mcMMO.isRetroModeEnabled())
|
||||
if (!mcMMO.isRetroModeEnabled()) {
|
||||
return config.getInt("Skills.General.Ability.Length.Standard.CapLevel", 50);
|
||||
else
|
||||
} else {
|
||||
return config.getInt("Skills.General.Ability.Length.RetroMode.CapLevel", 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the frequency at which abilities will increase in length
|
||||
* It returns a different value depending on whether the server is in retro mode
|
||||
* This returns the frequency at which abilities will increase in length It returns a different
|
||||
* value depending on whether the server is in retro mode
|
||||
*
|
||||
* @return the number of levels required per ability length increase
|
||||
*/
|
||||
public int getAbilityLength() {
|
||||
if (!mcMMO.isRetroModeEnabled())
|
||||
if (!mcMMO.isRetroModeEnabled()) {
|
||||
return config.getInt("Skills.General.Ability.Length.Standard.IncreaseLevel", 5);
|
||||
else
|
||||
} else {
|
||||
return config.getInt("Skills.General.Ability.Length.RetroMode.IncreaseLevel", 50);
|
||||
}
|
||||
}
|
||||
|
||||
public int getEnchantBuff() {
|
||||
@@ -456,17 +461,19 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Grabs the max bonus level for a skill used in RNG calculations
|
||||
* All max level values in the config are multiplied by 10 if the server is in retro mode as the values in the config are based around the new 1-100 skill system scaling
|
||||
* A value of 10 in the file will be returned as 100 for retro mode servers to accommodate the change in scaling
|
||||
* Grabs the max bonus level for a skill used in RNG calculations All max level values in the
|
||||
* config are multiplied by 10 if the server is in retro mode as the values in the config are
|
||||
* based around the new 1-100 skill system scaling A value of 10 in the file will be returned as
|
||||
* 100 for retro mode servers to accommodate the change in scaling
|
||||
*
|
||||
* @param subSkillType target subskill
|
||||
*
|
||||
* @return the level at which this skills max benefits will be reached on the curve
|
||||
*/
|
||||
public int getMaxBonusLevel(SubSkillType subSkillType) {
|
||||
String keyPath = subSkillType.getAdvConfigAddress() + ".MaxBonusLevel.";
|
||||
return mcMMO.isRetroModeEnabled() ? config.getInt(keyPath + "RetroMode", 1000) : config.getInt(keyPath + "Standard", 100);
|
||||
return mcMMO.isRetroModeEnabled() ? config.getInt(keyPath + "RetroMode", 1000)
|
||||
: config.getInt(
|
||||
keyPath + "Standard", 100);
|
||||
}
|
||||
|
||||
public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) {
|
||||
@@ -489,11 +496,15 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
public boolean doesNotificationUseActionBar(NotificationType notificationType) {
|
||||
return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".Enabled", true);
|
||||
return config.getBoolean(
|
||||
"Feedback.ActionBarNotifications." + notificationType.toString() + ".Enabled",
|
||||
true);
|
||||
}
|
||||
|
||||
public boolean doesNotificationSendCopyToChat(NotificationType notificationType) {
|
||||
return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".SendCopyOfMessageToChat", false);
|
||||
return config.getBoolean(
|
||||
"Feedback.ActionBarNotifications." + notificationType.toString()
|
||||
+ ".SendCopyOfMessageToChat", false);
|
||||
}
|
||||
|
||||
public boolean useTitlesForXPEvent() {
|
||||
@@ -501,63 +512,10 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
public boolean sendAbilityNotificationToOtherPlayers() {
|
||||
return config.getBoolean("Feedback.Events.AbilityActivation.SendNotificationToOtherPlayers", true);
|
||||
return config.getBoolean("Feedback.Events.AbilityActivation.SendNotificationToOtherPlayers",
|
||||
true);
|
||||
}
|
||||
|
||||
/*
|
||||
* JSON Style Settings
|
||||
*/
|
||||
|
||||
|
||||
/*public ChatColor getJSONStatHoverElementColor(StatType statType, boolean isPrefix) {
|
||||
String keyAddress = isPrefix ? "Prefix" : "Value";
|
||||
String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Color";
|
||||
|
||||
return getChatColorFromKey(keyLocation);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Used to color our details header in our JSON Hover Object tooltips
|
||||
*
|
||||
* @return the ChatColor for this element
|
||||
*/
|
||||
/*public ChatColor getJSONStatHoverDetailsColor() {
|
||||
String keyLocation = "Style.JSON.Hover.Details.Header.Color";
|
||||
return getChatColorFromKey(keyLocation);
|
||||
}
|
||||
|
||||
public boolean isJSONDetailsHeaderBold() {
|
||||
return config.getBoolean("Style.JSON.Hover.Details.Header.Bold");
|
||||
}
|
||||
|
||||
public boolean isJSONDetailsHeaderItalic() {
|
||||
return config.getBoolean("Style.JSON.Hover.Details.Header.Italics");
|
||||
}
|
||||
|
||||
public boolean isJSONDetailsHeaderUnderlined() {
|
||||
return config.getBoolean("Style.JSON.Hover.Details.Header.Underlined");
|
||||
}
|
||||
|
||||
public ChatColor getJSONStatHoverDescriptionColor() {
|
||||
String keyLocation = "Style.JSON.Hover.Details.Description.Color";
|
||||
return getChatColorFromKey(keyLocation);
|
||||
}
|
||||
|
||||
public boolean isJSONDetailsDescriptionBold() {
|
||||
return config.getBoolean("Style.JSON.Hover.Details.Description.Bold");
|
||||
}
|
||||
|
||||
public boolean isJSONDetailsDescriptionItalic() {
|
||||
return config.getBoolean("Style.JSON.Hover.Details.Description.Italics");
|
||||
}
|
||||
|
||||
public boolean isJSONDetailsDescriptionUnderlined() {
|
||||
return config.getBoolean("Style.JSON.Hover.Details.Description.Underlined");
|
||||
}
|
||||
|
||||
public ChatColor getJSONActionBarColor(NotificationType notificationType) {
|
||||
return getChatColor(config.getString("Style.JSON.Notification."+notificationType.toString()+".Color"));
|
||||
}*/
|
||||
private ChatColor getChatColorFromKey(String keyLocation) {
|
||||
String colorName = config.getString(keyLocation);
|
||||
|
||||
@@ -566,8 +524,9 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
|
||||
private ChatColor getChatColor(String configColor) {
|
||||
for (ChatColor chatColor : ChatColor.values()) {
|
||||
if (configColor.equalsIgnoreCase(chatColor.getName()))
|
||||
if (configColor.equalsIgnoreCase(chatColor.getName())) {
|
||||
return chatColor;
|
||||
}
|
||||
}
|
||||
|
||||
//Invalid Color
|
||||
@@ -811,10 +770,11 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
|
||||
/* SMELTING */
|
||||
public int getBurnModifierMaxLevel() {
|
||||
if (mcMMO.isRetroModeEnabled())
|
||||
if (mcMMO.isRetroModeEnabled()) {
|
||||
return config.getInt("Skills.Smelting.FuelEfficiency.RetroMode.MaxBonusLevel", 1000);
|
||||
else
|
||||
} else {
|
||||
return config.getInt("Skills.Smelting.FuelEfficiency.Standard.MaxBonusLevel", 100);
|
||||
}
|
||||
}
|
||||
|
||||
public double getFluxMiningChance() {
|
||||
@@ -903,7 +863,6 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
}
|
||||
|
||||
/* UNARMED */
|
||||
|
||||
public boolean isSteelArmDamageCustom() {
|
||||
return config.getBoolean("Skills.Unarmed.SteelArmStyle.Damage_Override", false);
|
||||
}
|
||||
@@ -919,12 +878,13 @@ public class AdvancedConfig extends BukkitConfig {
|
||||
|
||||
/* WOODCUTTING */
|
||||
public boolean isKnockOnWoodXPOrbEnabled() {
|
||||
return config.getBoolean("Skills.Woodcutting.TreeFeller.Knock_On_Wood.Add_XP_Orbs_To_Drops", true);
|
||||
return config.getBoolean("Skills.Woodcutting.TreeFeller.Knock_On_Wood.Add_XP_Orbs_To_Drops",
|
||||
true);
|
||||
}
|
||||
|
||||
/* MACES */
|
||||
public double getCrippleChanceToApplyOnHit(int rank) {
|
||||
String root = "Skills.Maces.Cripple.Chance_To_Apply_On_Hit.Rank_";
|
||||
return config.getDouble(root + rank, defaultCrippleValues[rank-1]);
|
||||
return config.getDouble(root + rank, defaultCrippleValues[rank - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user