2
0

AdvancedConfig.java 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951
  1. package com.gmail.nossr50.config;
  2. import com.gmail.nossr50.datatypes.interactions.NotificationType;
  3. import com.gmail.nossr50.datatypes.skills.SubSkillType;
  4. import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
  5. import com.gmail.nossr50.mcMMO;
  6. import net.md_5.bungee.api.ChatColor;
  7. import java.io.File;
  8. import java.util.ArrayList;
  9. import java.util.List;
  10. public class AdvancedConfig extends BukkitConfig {
  11. int[] defaultCrippleValues = new int[]{10, 15, 20, 25};
  12. public AdvancedConfig(File dataFolder) {
  13. super("advanced.yml", dataFolder);
  14. validate();
  15. }
  16. @Override
  17. protected boolean validateKeys() {
  18. // Validate all the settings!
  19. List<String> reason = new ArrayList<>();
  20. /* GENERAL */
  21. if (getAbilityLength() < 1) {
  22. reason.add("Skills.General.Ability.Length.<mode>.IncreaseLevel should be at least 1!");
  23. }
  24. if (getEnchantBuff() < 1) {
  25. reason.add("Skills.General.Ability.EnchantBuff should be at least 1!");
  26. }
  27. /* ACROBATICS */
  28. if (getMaximumProbability(SubSkillType.ACROBATICS_DODGE) < 1) {
  29. reason.add("Skills.Acrobatics.Dodge.ChanceMax should be at least 1!");
  30. }
  31. if (getMaxBonusLevel(SubSkillType.ACROBATICS_DODGE) < 1) {
  32. reason.add("Skills.Acrobatics.Dodge.MaxBonusLevel should be at least 1!");
  33. }
  34. if (getDodgeDamageModifier() <= 1) {
  35. reason.add("Skills.Acrobatics.Dodge.DamageModifier should be greater than 1!");
  36. }
  37. if (getMaximumProbability(SubSkillType.ACROBATICS_ROLL) < 1) {
  38. reason.add("Skills.Acrobatics.Roll.ChanceMax should be at least 1!");
  39. }
  40. if (getMaxBonusLevel(SubSkillType.ACROBATICS_ROLL) < 1) {
  41. reason.add("Skills.Acrobatics.Roll.MaxBonusLevel should be at least 1!");
  42. }
  43. if (getRollDamageThreshold() < 0) {
  44. reason.add("Skills.Acrobatics.Roll.DamageThreshold should be at least 0!");
  45. }
  46. if (getGracefulRollDamageThreshold() < 0) {
  47. reason.add("Skills.Acrobatics.GracefulRoll.DamageThreshold should be at least 0!");
  48. }
  49. if (getCatalysisMinSpeed() <= 0) {
  50. reason.add("Skills.Alchemy.Catalysis.MinSpeed must be greater than 0!");
  51. }
  52. if (getCatalysisMaxSpeed() < getCatalysisMinSpeed()) {
  53. reason.add("Skills.Alchemy.Catalysis.MaxSpeed should be at least Skills.Alchemy.Catalysis.MinSpeed!");
  54. }
  55. /* ARCHERY */
  56. if (getSkillShotRankDamageMultiplier() <= 0) {
  57. reason.add("Skills.Archery.SkillShot.RankDamageMultiplier should be greater than 0!");
  58. }
  59. if (getMaximumProbability(SubSkillType.ARCHERY_DAZE) < 1) {
  60. reason.add("Skills.Archery.Daze.ChanceMax should be at least 1!");
  61. }
  62. if (getMaxBonusLevel(SubSkillType.ARCHERY_DAZE) < 1) {
  63. reason.add("Skills.Archery.Daze.MaxBonusLevel should be at least 1!");
  64. }
  65. if (getDazeBonusDamage() < 0) {
  66. reason.add("Skills.Archery.Daze.BonusDamage should be at least 0!");
  67. }
  68. if (getMaximumProbability(SubSkillType.ARCHERY_ARROW_RETRIEVAL) < 1) {
  69. reason.add("Skills.Archery.Retrieve.ChanceMax should be at least 1!");
  70. }
  71. if (getMaxBonusLevel(SubSkillType.ARCHERY_ARROW_RETRIEVAL) < 1) {
  72. reason.add("Skills.Archery.Retrieve.MaxBonusLevel should be at least 1!");
  73. }
  74. if (getForceMultiplier() < 0) {
  75. reason.add("Skills.Archery.ForceMultiplier should be at least 0!");
  76. }
  77. /* AXES */
  78. if (getAxeMasteryRankDamageMultiplier() < 0) {
  79. reason.add("Skills.Axes.AxeMastery.RankDamageMultiplier should be at least 0!");
  80. }
  81. if (getMaximumProbability(SubSkillType.AXES_CRITICAL_STRIKES) < 1) {
  82. reason.add("Skills.Axes.CriticalHit.ChanceMax should be at least 1!");
  83. }
  84. if (getMaxBonusLevel(SubSkillType.AXES_CRITICAL_STRIKES) < 1) {
  85. reason.add("Skills.Axes.CriticalHit.MaxBonusLevel should be at least 1!");
  86. }
  87. if (getCriticalStrikesPVPModifier() < 1) {
  88. reason.add("Skills.Axes.CriticalStrikes.PVP_Modifier should be at least 1!");
  89. }
  90. if (getCriticalStrikesPVPModifier() < 1) {
  91. reason.add("Skills.Axes.CriticalStrikes.PVE_Modifier should be at least 1!");
  92. }
  93. if (getGreaterImpactChance() < 1) {
  94. reason.add("Skills.Axes.GreaterImpact.Chance should be at least 1!");
  95. }
  96. if (getGreaterImpactModifier() < 1) {
  97. reason.add("Skills.Axes.GreaterImpact.KnockbackModifier should be at least 1!");
  98. }
  99. if (getGreaterImpactBonusDamage() < 1) {
  100. reason.add("Skills.Axes.GreaterImpact.BonusDamage should be at least 1!");
  101. }
  102. if (getImpactChance() < 1) {
  103. reason.add("Skills.Axes.ArmorImpact.Chance should be at least 1!");
  104. }
  105. if (getSkullSplitterModifier() < 1) {
  106. reason.add("Skills.Axes.SkullSplitter.DamageModifier should be at least 1!");
  107. }
  108. /* FISHING */
  109. /*List<Fishing.Tier> fishingTierList = Arrays.asList(Fishing.Tier.values());
  110. for (int rank : fishingTierList) {
  111. if (getFishingTierLevel(tier) < 0) {
  112. reason.add("Skills.Fishing.Rank_Levels.Rank_" + rank + " should be at least 0!");
  113. }
  114. if (getShakeChance(tier) < 0) {
  115. reason.add("Skills.Fishing.Shake_Chance.Rank_" + rank + " should be at least 0!");
  116. }
  117. if (getFishingVanillaXPModifier(tier) < 0) {
  118. reason.add("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank + " should be at least 0!");
  119. }
  120. if (tier != Fishing.Tier.EIGHT) {
  121. Fishing.Tier nextTier = fishingTierList.get(fishingTierList.indexOf(tier) - 1);
  122. if (getFishingTierLevel(tier) > getFishingTierLevel(nextTier)) {
  123. reason.add("Skills.Fishing.Rank_Levels.Rank_" + rank + " should be less than or equal to Skills.Fishing.Rank_Levels.Rank_" + nextrank + "!");
  124. }
  125. if (getShakeChance(tier) > getShakeChance(nextTier)) {
  126. reason.add("Skills.Fishing.Shake_Chance.Rank_" + rank + " should be less than or equal to Skills.Fishing.Shake_Chance.Rank_" + nextrank + "!");
  127. }
  128. if (getFishingVanillaXPModifier(tier) > getFishingVanillaXPModifier(nextTier)) {
  129. reason.add("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank + " should be less than or equal to Skills.Fishing.VanillaXPMultiplier.Rank_" + nextrank + "!");
  130. }
  131. }
  132. }*/
  133. if (getFishermanDietRankChange() < 1) {
  134. reason.add("Skills.Fishing.FishermansDiet.RankChange should be at least 1!");
  135. }
  136. /*if (getIceFishingUnlockLevel() < 0) {
  137. reason.add("Skills.Fishing.IceFishing.UnlockLevel should be at least 0!");
  138. }
  139. if (getMasterAnglerUnlockLevel() < 0) {
  140. reason.add("Skills.Fishing.MasterAngler.UnlockLevel should be at least 0!");
  141. }*/
  142. if (getMasterAnglerBoatModifier() < 1) {
  143. reason.add("Skills.Fishing.MasterAngler.BoatModifier should be at least 1!");
  144. }
  145. if (getMasterAnglerBiomeModifier() < 1) {
  146. reason.add("Skills.Fishing.MasterAngler.BiomeModifier should be at least 1!");
  147. }
  148. /* HERBALISM */
  149. if (getFarmerDietRankChange() < 1) {
  150. reason.add("Skills.Herbalism.FarmersDiet.RankChange should be at least 1!");
  151. }
  152. if (getGreenThumbStageChange() < 1) {
  153. reason.add("Skills.Herbalism.GreenThumb.StageChange should be at least 1!");
  154. }
  155. if (getMaximumProbability(SubSkillType.HERBALISM_GREEN_THUMB) < 1) {
  156. reason.add("Skills.Herbalism.GreenThumb.ChanceMax should be at least 1!");
  157. }
  158. if (getMaxBonusLevel(SubSkillType.HERBALISM_GREEN_THUMB) < 1) {
  159. reason.add("Skills.Herbalism.GreenThumb.MaxBonusLevel should be at least 1!");
  160. }
  161. if (getMaximumProbability(SubSkillType.HERBALISM_DOUBLE_DROPS) < 1) {
  162. reason.add("Skills.Herbalism.DoubleDrops.ChanceMax should be at least 1!");
  163. }
  164. if (getMaxBonusLevel(SubSkillType.HERBALISM_DOUBLE_DROPS) < 1) {
  165. reason.add("Skills.Herbalism.DoubleDrops.MaxBonusLevel should be at least 1!");
  166. }
  167. if (getMaximumProbability(SubSkillType.HERBALISM_HYLIAN_LUCK) < 1) {
  168. reason.add("Skills.Herbalism.HylianLuck.ChanceMax should be at least 1!");
  169. }
  170. if (getMaxBonusLevel(SubSkillType.HERBALISM_HYLIAN_LUCK) < 1) {
  171. reason.add("Skills.Herbalism.HylianLuck.MaxBonusLevel should be at least 1!");
  172. }
  173. if (getMaximumProbability(SubSkillType.HERBALISM_SHROOM_THUMB) < 1) {
  174. reason.add("Skills.Herbalism.ShroomThumb.ChanceMax should be at least 1!");
  175. }
  176. if (getMaxBonusLevel(SubSkillType.HERBALISM_SHROOM_THUMB) < 1) {
  177. reason.add("Skills.Herbalism.ShroomThumb.MaxBonusLevel should be at least 1!");
  178. }
  179. /* MINING */
  180. if (getMaximumProbability(SubSkillType.MINING_DOUBLE_DROPS) < 1) {
  181. reason.add("Skills.Mining.DoubleDrops.ChanceMax should be at least 1!");
  182. }
  183. if (getMaxBonusLevel(SubSkillType.MINING_DOUBLE_DROPS) < 1) {
  184. reason.add("Skills.Mining.DoubleDrops.MaxBonusLevel should be at least 1!");
  185. }
  186. /* REPAIR */
  187. if (getRepairMasteryMaxBonus() < 1) {
  188. reason.add("Skills.Repair.RepairMastery.MaxBonusPercentage should be at least 1!");
  189. }
  190. if (getRepairMasteryMaxLevel() < 1) {
  191. reason.add("Skills.Repair.RepairMastery.MaxBonusLevel should be at least 1!");
  192. }
  193. if (getMaximumProbability(SubSkillType.REPAIR_SUPER_REPAIR) < 1) {
  194. reason.add("Skills.Repair.SuperRepair.ChanceMax should be at least 1!");
  195. }
  196. if (getMaxBonusLevel(SubSkillType.REPAIR_SUPER_REPAIR) < 1) {
  197. reason.add("Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1!");
  198. }
  199. /* SMELTING */
  200. if (getBurnModifierMaxLevel() < 1) {
  201. reason.add("Skills.Smelting.FuelEfficiency.MaxBonusLevel should be at least 1!");
  202. }
  203. if (getMaxBonusLevel(SubSkillType.SMELTING_SECOND_SMELT) < 1) {
  204. reason.add("Skills.Smelting.SecondSmelt.MaxBonusLevel should be at least 1!");
  205. }
  206. if (getMaximumProbability(SubSkillType.SMELTING_SECOND_SMELT) < 1) {
  207. reason.add("Skills.Smelting.SecondSmelt.ChanceMax should be at least 1!");
  208. }
  209. if (getFluxMiningChance() < 1) {
  210. reason.add("Skills.Smelting.FluxMining.Chance should be at least 1!");
  211. }
  212. /* SWORDS */
  213. if (getMaximumProbability(SubSkillType.SWORDS_COUNTER_ATTACK) < 1) {
  214. reason.add("Skills.Swords.CounterAttack.ChanceMax should be at least 1!");
  215. }
  216. if (getMaxBonusLevel(SubSkillType.SWORDS_COUNTER_ATTACK) < 1) {
  217. reason.add("Skills.Swords.CounterAttack.MaxBonusLevel should be at least 1!");
  218. }
  219. if (getCounterModifier() < 1) {
  220. reason.add("Skills.Swords.CounterAttack.DamageModifier should be at least 1!");
  221. }
  222. if (getSerratedStrikesModifier() < 1) {
  223. reason.add("Skills.Swords.SerratedStrikes.DamageModifier should be at least 1!");
  224. }
  225. if (getSerratedStrikesTicks() < 1) {
  226. reason.add("Skills.Swords.SerratedStrikes.RuptureTicks should be at least 1!");
  227. }
  228. /* TAMING */
  229. if (getMaximumProbability(SubSkillType.TAMING_GORE) < 1) {
  230. reason.add("Skills.Taming.Gore.ChanceMax should be at least 1!");
  231. }
  232. if (getMaxBonusLevel(SubSkillType.TAMING_GORE) < 1) {
  233. reason.add("Skills.Taming.Gore.MaxBonusLevel should be at least 1!");
  234. }
  235. /*if (getGoreRuptureTicks() < 1) {
  236. reason.add("Skills.Taming.Gore.RuptureTicks should be at least 1!");
  237. }*/
  238. if (getGoreModifier() < 1) {
  239. reason.add("Skills.Taming.Gore.Modifier should be at least 1!");
  240. }
  241. /*if (getFastFoodUnlock() < 0) {
  242. reason.add("Skills.Taming.FastFood.UnlockLevel should be at least 0!");
  243. }*/
  244. if (getFastFoodChance() < 1) {
  245. reason.add("Skills.Taming.FastFood.Chance should be at least 1!");
  246. }
  247. /*if (getEnviromentallyAwareUnlock() < 0) {
  248. reason.add("Skills.Taming.EnvironmentallyAware.UnlockLevel should be at least 0!");
  249. }*/
  250. /*if (getThickFurUnlock() < 0) {
  251. reason.add("Skills.Taming.ThickFur.UnlockLevel should be at least 0!");
  252. }*/
  253. if (getThickFurModifier() < 1) {
  254. reason.add("Skills.Taming.ThickFur.Modifier should be at least 1!");
  255. }
  256. /*if (getHolyHoundUnlock() < 0) {
  257. reason.add("Skills.Taming.HolyHound.UnlockLevel should be at least 0!");
  258. }
  259. if (getShockProofUnlock() < 0) {
  260. reason.add("Skills.Taming.ShockProof.UnlockLevel should be at least 0!");
  261. }*/
  262. if (getShockProofModifier() < 1) {
  263. reason.add("Skills.Taming.ShockProof.Modifier should be at least 1!");
  264. }
  265. /*if (getSharpenedClawsUnlock() < 0) {
  266. reason.add("Skills.Taming.SharpenedClaws.UnlockLevel should be at least 0!");
  267. }*/
  268. if (getSharpenedClawsBonus() < 1) {
  269. reason.add("Skills.Taming.SharpenedClaws.Bonus should be at least 1!");
  270. }
  271. if (getMaxHorseJumpStrength() < 0 || getMaxHorseJumpStrength() > 2) {
  272. reason.add("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength should be between 0 and 2!");
  273. }
  274. /* UNARMED */
  275. if (getMaximumProbability(SubSkillType.UNARMED_DISARM) < 1) {
  276. reason.add("Skills.Unarmed.Disarm.ChanceMax should be at least 1!");
  277. }
  278. if (getMaxBonusLevel(SubSkillType.UNARMED_DISARM) < 1) {
  279. reason.add("Skills.Unarmed.Disarm.MaxBonusLevel should be at least 1!");
  280. }
  281. if (getMaximumProbability(SubSkillType.UNARMED_ARROW_DEFLECT) < 1) {
  282. reason.add("Skills.Unarmed.ArrowDeflect.ChanceMax should be at least 1!");
  283. }
  284. if (getMaxBonusLevel(SubSkillType.UNARMED_ARROW_DEFLECT) < 1) {
  285. reason.add("Skills.Unarmed.ArrowDeflect.MaxBonusLevel should be at least 1!");
  286. }
  287. if (getMaximumProbability(SubSkillType.UNARMED_IRON_GRIP) < 1) {
  288. reason.add("Skills.Unarmed.IronGrip.ChanceMax should be at least 1!");
  289. }
  290. if (getMaxBonusLevel(SubSkillType.UNARMED_IRON_GRIP) < 1) {
  291. reason.add("Skills.Unarmed.IronGrip.MaxBonusLevel should be at least 1!");
  292. }
  293. /* WOODCUTTING */
  294. /*if (getLeafBlowUnlockLevel() < 0) {
  295. reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 0!");
  296. }*/
  297. if (getMaximumProbability(SubSkillType.WOODCUTTING_HARVEST_LUMBER) < 1) {
  298. reason.add("Skills.Woodcutting.HarvestLumber.ChanceMax should be at least 1!");
  299. }
  300. if (getMaxBonusLevel(SubSkillType.WOODCUTTING_HARVEST_LUMBER) < 1) {
  301. reason.add("Skills.Woodcutting.HarvestLumber.MaxBonusLevel should be at least 1!");
  302. }
  303. return noErrorsInConfig(reason);
  304. }
  305. @Override
  306. protected void loadKeys() {
  307. }
  308. /* GENERAL */
  309. public boolean useAttackCooldown() {
  310. return config.getBoolean("Skills.General.Attack_Cooldown.Adjust_Skills_For_Attack_Cooldown", true);
  311. }
  312. public boolean canApplyLimitBreakPVE() {
  313. return config.getBoolean("Skills.General.LimitBreak.AllowPVE", false);
  314. }
  315. public int getStartingLevel() {
  316. return config.getInt("Skills.General.StartingLevel", 1);
  317. }
  318. public boolean allowPlayerTips() {
  319. return config.getBoolean("Feedback.PlayerTips", true);
  320. }
  321. /**
  322. * This returns the maximum level at which superabilities will stop lengthening from scaling alongside skill level.
  323. * It returns a different value depending on whether the server is in retro mode
  324. *
  325. * @return the level at which abilities stop increasing in length
  326. */
  327. public int getAbilityLengthCap() {
  328. if (!mcMMO.isRetroModeEnabled())
  329. return config.getInt("Skills.General.Ability.Length.Standard.CapLevel", 50);
  330. else
  331. return config.getInt("Skills.General.Ability.Length.RetroMode.CapLevel", 500);
  332. }
  333. /**
  334. * This returns the frequency at which abilities will increase in length
  335. * It returns a different value depending on whether the server is in retro mode
  336. *
  337. * @return the number of levels required per ability length increase
  338. */
  339. public int getAbilityLength() {
  340. if (!mcMMO.isRetroModeEnabled())
  341. return config.getInt("Skills.General.Ability.Length.Standard.IncreaseLevel", 5);
  342. else
  343. return config.getInt("Skills.General.Ability.Length.RetroMode.IncreaseLevel", 50);
  344. }
  345. public int getEnchantBuff() {
  346. return config.getInt("Skills.General.Ability.EnchantBuff", 5);
  347. }
  348. /**
  349. * Grabs the max bonus level for a skill used in RNG calculations
  350. * 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
  351. * A value of 10 in the file will be returned as 100 for retro mode servers to accommodate the change in scaling
  352. *
  353. * @param subSkillType target subskill
  354. *
  355. * @return the level at which this skills max benefits will be reached on the curve
  356. */
  357. public int getMaxBonusLevel(SubSkillType subSkillType) {
  358. String keyPath = subSkillType.getAdvConfigAddress() + ".MaxBonusLevel.";
  359. return mcMMO.isRetroModeEnabled() ? config.getInt(keyPath + "RetroMode", 1000) : config.getInt(keyPath + "Standard", 100);
  360. }
  361. public int getMaxBonusLevel(AbstractSubSkill abstractSubSkill) {
  362. return getMaxBonusLevel(abstractSubSkill.getSubSkillType());
  363. }
  364. public double getMaximumProbability(SubSkillType subSkillType) {
  365. return config.getDouble(subSkillType.getAdvConfigAddress() + ".ChanceMax", 100.0D);
  366. }
  367. public double getMaximumProbability(AbstractSubSkill abstractSubSkill) {
  368. return getMaximumProbability(abstractSubSkill.getSubSkillType());
  369. }
  370. /* Notification Settings */
  371. public boolean doesSkillCommandSendBlankLines() {
  372. return config.getBoolean("Feedback.SkillCommand.BlankLinesAboveHeader", true);
  373. }
  374. public boolean doesNotificationUseActionBar(NotificationType notificationType) {
  375. return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".Enabled", true);
  376. }
  377. public boolean doesNotificationSendCopyToChat(NotificationType notificationType) {
  378. return config.getBoolean("Feedback.ActionBarNotifications." + notificationType.toString() + ".SendCopyOfMessageToChat", false);
  379. }
  380. public boolean useTitlesForXPEvent() {
  381. return config.getBoolean("Feedback.Events.XP.SendTitles", true);
  382. }
  383. public boolean sendAbilityNotificationToOtherPlayers() {
  384. return config.getBoolean("Feedback.Events.AbilityActivation.SendNotificationToOtherPlayers", true);
  385. }
  386. /*
  387. * JSON Style Settings
  388. */
  389. /*public ChatColor getJSONStatHoverElementColor(StatType statType, boolean isPrefix) {
  390. String keyAddress = isPrefix ? "Prefix" : "Value";
  391. String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Color";
  392. return getChatColorFromKey(keyLocation);
  393. }*/
  394. /**
  395. * Used to color our details header in our JSON Hover Object tooltips
  396. *
  397. * @return the ChatColor for this element
  398. */
  399. /*public ChatColor getJSONStatHoverDetailsColor() {
  400. String keyLocation = "Style.JSON.Hover.Details.Header.Color";
  401. return getChatColorFromKey(keyLocation);
  402. }
  403. public boolean isJSONDetailsHeaderBold() {
  404. return config.getBoolean("Style.JSON.Hover.Details.Header.Bold");
  405. }
  406. public boolean isJSONDetailsHeaderItalic() {
  407. return config.getBoolean("Style.JSON.Hover.Details.Header.Italics");
  408. }
  409. public boolean isJSONDetailsHeaderUnderlined() {
  410. return config.getBoolean("Style.JSON.Hover.Details.Header.Underlined");
  411. }
  412. public ChatColor getJSONStatHoverDescriptionColor() {
  413. String keyLocation = "Style.JSON.Hover.Details.Description.Color";
  414. return getChatColorFromKey(keyLocation);
  415. }
  416. public boolean isJSONDetailsDescriptionBold() {
  417. return config.getBoolean("Style.JSON.Hover.Details.Description.Bold");
  418. }
  419. public boolean isJSONDetailsDescriptionItalic() {
  420. return config.getBoolean("Style.JSON.Hover.Details.Description.Italics");
  421. }
  422. public boolean isJSONDetailsDescriptionUnderlined() {
  423. return config.getBoolean("Style.JSON.Hover.Details.Description.Underlined");
  424. }
  425. public ChatColor getJSONActionBarColor(NotificationType notificationType) {
  426. return getChatColor(config.getString("Style.JSON.Notification."+notificationType.toString()+".Color"));
  427. }*/
  428. private ChatColor getChatColorFromKey(String keyLocation) {
  429. String colorName = config.getString(keyLocation);
  430. return getChatColor(colorName);
  431. }
  432. private ChatColor getChatColor(String configColor) {
  433. for (ChatColor chatColor : ChatColor.values()) {
  434. if (configColor.equalsIgnoreCase(chatColor.getName()))
  435. return chatColor;
  436. }
  437. //Invalid Color
  438. mcMMO.p.getLogger().warning(configColor + " is an invalid color value");
  439. return ChatColor.WHITE;
  440. }
  441. /*public boolean isJSONStatHoverElementBold(StatType statType, boolean isPrefix) {
  442. String keyAddress = isPrefix ? "Prefix" : "Value";
  443. String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Bold";
  444. return config.getBoolean(keyLocation);
  445. }
  446. public boolean isJSONStatHoverElementItalic(StatType statType, boolean isPrefix) {
  447. String keyAddress = isPrefix ? "Prefix" : "Value";
  448. String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Italics";
  449. return config.getBoolean(keyLocation);
  450. }
  451. public boolean isJSONStatHoverElementUnderlined(StatType statType, boolean isPrefix) {
  452. String keyAddress = isPrefix ? "Prefix" : "Value";
  453. String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Underline";
  454. return config.getBoolean(keyLocation);
  455. }*/
  456. /**
  457. * Some SubSkills have the ability to retain classic functionality
  458. *
  459. * @param subSkillType SubSkillType with classic functionality
  460. *
  461. * @return true if the subskill is in classic mode
  462. */
  463. public boolean isSubSkillClassic(SubSkillType subSkillType) {
  464. return config.getBoolean(subSkillType.getAdvConfigAddress() + ".Classic");
  465. }
  466. /* ACROBATICS */
  467. public double getDodgeDamageModifier() {
  468. return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D);
  469. }
  470. public double getRollDamageThreshold() {
  471. return config.getDouble("Skills.Acrobatics.Roll.DamageThreshold", 7.0D);
  472. }
  473. public double getGracefulRollDamageThreshold() {
  474. return config.getDouble("Skills.Acrobatics.GracefulRoll.DamageThreshold", 14.0D);
  475. }
  476. /* ALCHEMY */
  477. public int getCatalysisMaxBonusLevel() {
  478. if (mcMMO.isRetroModeEnabled()) {
  479. return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel.RetroMode", 1000);
  480. } else {
  481. return config.getInt("Skills.Alchemy.Catalysis.MaxBonusLevel.Standard", 100);
  482. }
  483. }
  484. public double getCatalysisMinSpeed() {
  485. return config.getDouble("Skills.Alchemy.Catalysis.MinSpeed", 1.0D);
  486. }
  487. public double getCatalysisMaxSpeed() {
  488. return config.getDouble("Skills.Alchemy.Catalysis.MaxSpeed", 4.0D);
  489. }
  490. /* ARCHERY */
  491. public double getSkillShotRankDamageMultiplier() {
  492. return config.getDouble("Skills.Archery.SkillShot.RankDamageMultiplier", 10.0D);
  493. }
  494. public double getSkillShotDamageMax() {
  495. return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D);
  496. }
  497. public double getDazeBonusDamage() {
  498. return config.getDouble("Skills.Archery.Daze.BonusDamage", 4.0D);
  499. }
  500. public double getForceMultiplier() {
  501. return config.getDouble("Skills.Archery.ForceMultiplier", 2.0D);
  502. }
  503. /* AXES */
  504. public double getAxeMasteryRankDamageMultiplier() {
  505. return config.getDouble("Skills.Axes.AxeMastery.RankDamageMultiplier", 1.0D);
  506. }
  507. public double getCriticalStrikesPVPModifier() {
  508. return config.getDouble("Skills.Axes.CriticalStrikes.PVP_Modifier", 1.5D);
  509. }
  510. public double getCriticalStrikesPVEModifier() {
  511. return config.getDouble("Skills.Axes.CriticalStrikes.PVE_Modifier", 2.0D);
  512. }
  513. public double getGreaterImpactChance() {
  514. return config.getDouble("Skills.Axes.GreaterImpact.Chance", 25.0D);
  515. }
  516. public double getGreaterImpactModifier() {
  517. return config.getDouble("Skills.Axes.GreaterImpact.KnockbackModifier", 1.5D);
  518. }
  519. public double getGreaterImpactBonusDamage() {
  520. return config.getDouble("Skills.Axes.GreaterImpact.BonusDamage", 2.0D);
  521. }
  522. public double getImpactChance() {
  523. return config.getDouble("Skills.Axes.ArmorImpact.Chance", 25.0D);
  524. }
  525. public double getImpactDurabilityDamageMultiplier() {
  526. return config.getDouble("Skills.Axes.ArmorImpact.DamagePerRank", 6.5D);
  527. }
  528. public double getSkullSplitterModifier() {
  529. return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D);
  530. }
  531. /* CROSSBOWS */
  532. public double getPoweredShotRankDamageMultiplier() {
  533. return config.getDouble("Skills.Crossbows.PoweredShot.RankDamageMultiplier", 10.0D);
  534. }
  535. public double getPoweredShotDamageMax() {
  536. return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D);
  537. }
  538. /* EXCAVATION */
  539. //Nothing to configure, everything is already configurable in config.yml
  540. /* FISHING */
  541. public double getShakeChance(int rank) {
  542. return config.getDouble("Skills.Fishing.ShakeChance.Rank_" + rank);
  543. }
  544. public int getFishingVanillaXPModifier(int rank) {
  545. return config.getInt("Skills.Fishing.VanillaXPMultiplier.Rank_" + rank);
  546. }
  547. public int getFishingReductionMinWaitTicks() {
  548. return config.getInt("Skills.Fishing.MasterAngler.Tick_Reduction_Per_Rank.Min_Wait", 10);
  549. }
  550. public int getFishingReductionMaxWaitTicks() {
  551. return config.getInt("Skills.Fishing.MasterAngler.Tick_Reduction_Per_Rank.Max_Wait", 30);
  552. }
  553. public int getFishingBoatReductionMinWaitTicks() {
  554. return config.getInt("Skills.Fishing.MasterAngler.Boat_Tick_Reduction.Min_Wait", 10);
  555. }
  556. public int getFishingBoatReductionMaxWaitTicks() {
  557. return config.getInt("Skills.Fishing.MasterAngler.Boat_Tick_Reduction.Max_Wait", 30);
  558. }
  559. public int getFishingReductionMinWaitCap() {
  560. return config.getInt("Skills.Fishing.MasterAngler.Tick_Reduction_Caps.Min_Wait", 40);
  561. }
  562. public int getFishingReductionMaxWaitCap() {
  563. return config.getInt("Skills.Fishing.MasterAngler.Tick_Reduction_Caps.Max_Wait", 100);
  564. }
  565. public int getFishermanDietRankChange() {
  566. return config.getInt("Skills.Fishing.FishermansDiet.RankChange", 200);
  567. }
  568. public double getMasterAnglerBoatModifier() {
  569. return config.getDouble("Skills.Fishing.MasterAngler.BoatModifier", 2.0);
  570. }
  571. public double getMasterAnglerBiomeModifier() {
  572. return config.getDouble("Skills.Fishing.MasterAngler.BiomeModifier", 2.0);
  573. }
  574. /* HERBALISM */
  575. public int getFarmerDietRankChange() {
  576. return config.getInt("Skills.Herbalism.FarmersDiet.RankChange", 200);
  577. }
  578. public int getGreenThumbStageChange() {
  579. return config.getInt("Skills.Herbalism.GreenThumb.StageChange", 200);
  580. }
  581. /* MINING */
  582. public boolean getDoubleDropSilkTouchEnabled() {
  583. return config.getBoolean("Skills.Mining.DoubleDrops.SilkTouch", true);
  584. }
  585. public boolean getAllowMiningTripleDrops() {
  586. return config.getBoolean("Skills.Mining.SuperBreaker.AllowTripleDrops", true);
  587. }
  588. public int getBlastMiningRankLevel(int rank) {
  589. return config.getInt("Skills.Mining.BlastMining.Rank_Levels.Rank_" + rank);
  590. }
  591. public double getBlastDamageDecrease(int rank) {
  592. return config.getDouble("Skills.Mining.BlastMining.BlastDamageDecrease.Rank_" + rank);
  593. }
  594. public double getOreBonus(int rank) {
  595. return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank);
  596. }
  597. public boolean isBlastMiningBonusDropsEnabled() {
  598. return config.getBoolean("Skills.Mining.BlastMining.Bonus_Drops.Enabled", true);
  599. }
  600. public double getDebrisReduction(int rank) {
  601. return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank);
  602. }
  603. public int getDropMultiplier(int rank) {
  604. return config.getInt("Skills.Mining.BlastMining.DropMultiplier.Rank_" + rank);
  605. }
  606. public double getBlastRadiusModifier(int rank) {
  607. return config.getDouble("Skills.Mining.BlastMining.BlastRadiusModifier.Rank_" + rank);
  608. }
  609. /* REPAIR */
  610. public double getRepairMasteryMaxBonus() {
  611. return config.getDouble("Skills.Repair.RepairMastery.MaxBonusPercentage", 200.0D);
  612. }
  613. public int getRepairMasteryMaxLevel() {
  614. return config.getInt("Skills.Repair.RepairMastery.MaxBonusLevel", 100);
  615. }
  616. public boolean getAllowEnchantedRepairMaterials() {
  617. return config.getBoolean("Skills.Repair.Use_Enchanted_Materials", false);
  618. }
  619. public boolean getArcaneForgingEnchantLossEnabled() {
  620. return config.getBoolean("Skills.Repair.ArcaneForging.May_Lose_Enchants", true);
  621. }
  622. public double getArcaneForgingKeepEnchantsChance(int rank) {
  623. return config.getDouble("Skills.Repair.ArcaneForging.Keep_Enchants_Chance.Rank_" + rank);
  624. }
  625. public boolean getArcaneForgingDowngradeEnabled() {
  626. return config.getBoolean("Skills.Repair.ArcaneForging.Downgrades_Enabled", true);
  627. }
  628. public double getArcaneForgingDowngradeChance(int rank) {
  629. return config.getDouble("Skills.Repair.ArcaneForging.Downgrades_Chance.Rank_" + rank);
  630. }
  631. public boolean getArcaneSalvageEnchantDowngradeEnabled() {
  632. return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantDowngradeEnabled", true);
  633. }
  634. public boolean getArcaneSalvageEnchantLossEnabled() {
  635. return config.getBoolean("Skills.Salvage.ArcaneSalvage.EnchantLossEnabled", true);
  636. }
  637. public double getArcaneSalvageExtractFullEnchantsChance(int rank) {
  638. return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractFullEnchant.Rank_" + rank);
  639. }
  640. public double getArcaneSalvageExtractPartialEnchantsChance(int rank) {
  641. return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank);
  642. }
  643. /* SMELTING */
  644. public int getBurnModifierMaxLevel() {
  645. if (mcMMO.isRetroModeEnabled())
  646. return config.getInt("Skills.Smelting.FuelEfficiency.RetroMode.MaxBonusLevel", 1000);
  647. else
  648. return config.getInt("Skills.Smelting.FuelEfficiency.Standard.MaxBonusLevel", 100);
  649. }
  650. public double getFluxMiningChance() {
  651. return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D);
  652. }
  653. /* SWORDS */
  654. public double getRuptureTickDamage(boolean isTargetPlayer, int rank) {
  655. String root = "Skills.Swords.Rupture.Rupture_Mechanics.Tick_Interval_Damage.Against_";
  656. String targetType = isTargetPlayer ? "Players" : "Mobs";
  657. String key = root + targetType + ".Rank_" + rank;
  658. return config.getDouble(key, 1.0D);
  659. }
  660. public int getRuptureDurationSeconds(boolean isTargetPlayer) {
  661. String root = "Skills.Swords.Rupture.Rupture_Mechanics.Duration_In_Seconds.Against_";
  662. String targetType = isTargetPlayer ? "Players" : "Mobs";
  663. return config.getInt(root + targetType, 5);
  664. }
  665. public double getRuptureExplosionDamage(boolean isTargetPlayer, int rank) {
  666. String root = "Skills.Swords.Rupture.Rupture_Mechanics.Explosion_Damage.Against_";
  667. String targetType = isTargetPlayer ? "Players" : "Mobs";
  668. String key = root + targetType + ".Rank_" + rank;
  669. return config.getDouble(key, 40.0D);
  670. }
  671. public double getRuptureChanceToApplyOnHit(int rank) {
  672. String root = "Skills.Swords.Rupture.Rupture_Mechanics.Chance_To_Apply_On_Hit.Rank_";
  673. return config.getDouble(root + rank, 33);
  674. }
  675. public double getCounterModifier() {
  676. return config.getDouble("Skills.Swords.CounterAttack.DamageModifier", 2.0D);
  677. }
  678. public double getSerratedStrikesModifier() {
  679. return config.getDouble("Skills.Swords.SerratedStrikes.DamageModifier", 4.0D);
  680. }
  681. public int getSerratedStrikesTicks() {
  682. return config.getInt("Skills.Swords.SerratedStrikes.RuptureTicks", 5);
  683. }
  684. /* TAMING */
  685. public double getGoreModifier() {
  686. return config.getDouble("Skills.Taming.Gore.Modifier", 2.0D);
  687. }
  688. public double getFastFoodChance() {
  689. return config.getDouble("Skills.Taming.FastFoodService.Chance", 50.0D);
  690. }
  691. public double getPummelChance() {
  692. return config.getDouble("Skills.Taming.Pummel.Chance", 10.0D);
  693. }
  694. public double getThickFurModifier() {
  695. return config.getDouble("Skills.Taming.ThickFur.Modifier", 2.0D);
  696. }
  697. public double getShockProofModifier() {
  698. return config.getDouble("Skills.Taming.ShockProof.Modifier", 6.0D);
  699. }
  700. public double getSharpenedClawsBonus() {
  701. return config.getDouble("Skills.Taming.SharpenedClaws.Bonus", 2.0D);
  702. }
  703. public double getMinHorseJumpStrength() {
  704. return config.getDouble("Skills.Taming.CallOfTheWild.MinHorseJumpStrength", 0.7D);
  705. }
  706. public double getMaxHorseJumpStrength() {
  707. return config.getDouble("Skills.Taming.CallOfTheWild.MaxHorseJumpStrength", 2.0D);
  708. }
  709. /* UNARMED */
  710. public boolean isSteelArmDamageCustom() {
  711. return config.getBoolean("Skills.Unarmed.SteelArmStyle.Damage_Override", false);
  712. }
  713. public double getSteelArmOverride(int rank, double def) {
  714. String key = "Rank_" + rank;
  715. return config.getDouble("Skills.Unarmed.SteelArmStyle.Override." + key, def);
  716. }
  717. public boolean getDisarmProtected() {
  718. return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false);
  719. }
  720. /* WOODCUTTING */
  721. public boolean isKnockOnWoodXPOrbEnabled() {
  722. return config.getBoolean("Skills.Woodcutting.TreeFeller.Knock_On_Wood.Add_XP_Orbs_To_Drops", true);
  723. }
  724. /* MACES */
  725. public double getCrippleChanceToApplyOnHit(int rank) {
  726. String root = "Skills.Maces.Cripple.Chance_To_Apply_On_Hit.Rank_";
  727. return config.getDouble(root + rank, defaultCrippleValues[rank-1]);
  728. }
  729. }