Config.java 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. package com.gmail.nossr50.config;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import java.util.Set;
  5. import org.bukkit.Material;
  6. import org.bukkit.configuration.ConfigurationSection;
  7. import org.bukkit.entity.EntityType;
  8. import com.gmail.nossr50.mcMMO;
  9. import com.gmail.nossr50.datatypes.MobHealthbarType;
  10. import com.gmail.nossr50.datatypes.skills.AbilityType;
  11. import com.gmail.nossr50.datatypes.skills.SkillType;
  12. import com.gmail.nossr50.skills.repair.RepairMaterialType;
  13. import com.gmail.nossr50.util.StringUtils;
  14. public class Config extends AutoUpdateConfigLoader {
  15. private static Config instance;
  16. private Config() {
  17. super("config.yml");
  18. loadKeys();
  19. }
  20. public static Config getInstance() {
  21. if (instance == null) {
  22. instance = new Config();
  23. }
  24. return instance;
  25. }
  26. @Override
  27. protected void loadKeys() {
  28. // Validate all the settings!
  29. List<String> reason = new ArrayList<String>();
  30. /* General Settings */
  31. if (getSaveInterval() <= 0) {
  32. reason.add("General.Save_Interval should be greater than 0!");
  33. }
  34. /* Mob Healthbar */
  35. if (getMobHealthbarTime() == 0) {
  36. reason.add("Mob_Healthbar.Display_Time cannot be 0! Set to -1 to disable or set a valid value.");
  37. }
  38. /* Scoreboards */
  39. if (getMcrankScoreboardTime() != -1 && getMcrankScoreboardTime() <= 0) {
  40. reason.add("Scoreboards.Mcrank.Display_Time should be greater than 0 or -1!");
  41. }
  42. if (getMcstatsScoreboardTime() != -1 && getMcstatsScoreboardTime() <= 0) {
  43. reason.add("Scoreboards.Mcstats.Display_Time should be greater than 0 or -1!");
  44. }
  45. if (getMctopScoreboardTime() != -1 && getMctopScoreboardTime() <= 0) {
  46. reason.add("Scoreboards.Mctop.Display_Time should be greater than 0 or -1!");
  47. }
  48. if (getInspectScoreboardTime() != -1 && getInspectScoreboardTime() <= 0) {
  49. reason.add("Scoreboards.Inspect.Display_Time should be greater than 0 or -1!");
  50. }
  51. if (getSkillScoreboardTime() != -1 && getSkillScoreboardTime() <= 0) {
  52. reason.add("Scoreboards.Skillname.Display_Time should be greater than 0 or -1!");
  53. }
  54. /* Database Purging */
  55. if (getPurgeInterval() < -1) {
  56. reason.add("Database_Purging.Purge_Interval should be greater than, or equal to -1!");
  57. }
  58. if (getOldUsersCutoff() != -1 && getOldUsersCutoff() <= 0) {
  59. reason.add("Database_Purging.Old_User_Cutoff should be greater than 0 or -1!");
  60. }
  61. /* Hardcore Mode */
  62. if (getHardcoreDeathStatPenaltyPercentage() < 1 || getHardcoreDeathStatPenaltyPercentage() > 100) {
  63. reason.add("Hardcore.Death_Stat_Loss_Penalty_Percentage only accepts values from 1 to 100!");
  64. }
  65. if (getHardcoreVampirismStatLeechPercentage() < 1 || getHardcoreVampirismStatLeechPercentage() > 100) {
  66. reason.add("Hardcore.Death_Stat_Loss_Penalty_Percentage only accepts values from 1 to 100!");
  67. }
  68. /* Items */
  69. if (getChimaeraUseCost() < 1 || getChimaeraUseCost() > 64) {
  70. reason.add("Items.Chimaera_Wing.Use_Cost only accepts values from 1 to 64!");
  71. }
  72. if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) {
  73. reason.add("Items.Chimaera_Wing.Recipe_Cost only accepts values from 1 to 64!");
  74. }
  75. if (getChimaeraItemId() < 1) {
  76. reason.add("Items.Chimaera_Wing.Item_ID should be at least 1!");
  77. }
  78. /* Particles */
  79. if (getLevelUpEffectsTier() < 1) {
  80. reason.add("Particles.LevelUp_Tier should be at least 1!");
  81. }
  82. /* PARTY SETTINGS */
  83. if (getAutoPartyKickInterval() < -1) {
  84. reason.add("Party.AutoKick_Interval should be at least -1!");
  85. }
  86. if (getAutoPartyKickTime() < 0) {
  87. reason.add("Party.Old_Party_Member_Cutoff should be at least 0!");
  88. }
  89. if (getPartyShareBonusBase() <= 0) {
  90. reason.add("Party.Sharing.ExpShare_bonus_base should be greater than 0!");
  91. }
  92. if (getPartyShareBonusIncrease() < 0) {
  93. reason.add("Party.Sharing.ExpShare_bonus_increase should be at least 0!");
  94. }
  95. if (getPartyShareBonusCap() <= 0) {
  96. reason.add("Party.Sharing.ExpShare_bonus_cap should be greater than 0!");
  97. }
  98. if (getPartyShareRange() <= 0) {
  99. reason.add("Party.Sharing.Range should be greater than 0!");
  100. }
  101. /* Inspect command distance */
  102. if (getInspectDistance() <= 0) {
  103. reason.add("Commands.inspect.Max_Distance should be greater than 0!");
  104. }
  105. if (getTreeFellerThreshold() <= 0) {
  106. reason.add("Abilities.Limits.Tree_Feller_Threshold should be greater than 0!");
  107. }
  108. if (getFishingBaseXP() <= 0) {
  109. reason.add("Experience.Fishing.Base should be greater than 0!");
  110. }
  111. if (getDetonatorItemID() < 1) {
  112. reason.add("Skills.Mining.Detonator_ID should be at least 1!");
  113. }
  114. if (getRepairAnvilId() < 1) {
  115. reason.add("Skills.Repair.Anvil_ID should be at least 1!");
  116. }
  117. if (getSalvageAnvilId() < 1) {
  118. reason.add("Skills.Repair.Salvage_Anvil_ID should be at least 1!");
  119. }
  120. if (getRepairAnvilId() == getSalvageAnvilId()) {
  121. reason.add("Cannot use the same item ID for Repair and Salvage anvils!");
  122. }
  123. if (getTamingCOTWWolfCost() < 1) {
  124. reason.add("Skills.Taming.Call_Of_The_Wild.Bones_Required should be at least 1!");
  125. }
  126. if (getTamingCOTWOcelotCost() < 1) {
  127. reason.add("Skills.Taming.Call_Of_The_Wild.Fish_Required should be at least 1!");
  128. }
  129. if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) {
  130. reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot_Amount should be greater than 0!");
  131. }
  132. if (getTamingCOTWAmount(EntityType.WOLF) <= 0) {
  133. reason.add("Skills.Taming.Call_Of_The_Wild.Wolf_Amount should be greater than 0!");
  134. }
  135. if (getExperienceGainsGlobalMultiplier() <= 0) {
  136. reason.add("Experience.Gains.Multiplier.Global should be greater than 0!");
  137. }
  138. if (getPlayerVersusPlayerXP() < 0) {
  139. reason.add("Experience.Gains.Multiplier.PVP should be at least 0!");
  140. }
  141. if (getAnimalsXP() < 0) {
  142. reason.add("Experience.Gains.Multiplier.Animals should be at least 0!");
  143. }
  144. if (getWitherSkeletonXP() < 0) {
  145. reason.add("Experience.Gains.Multiplier.Wither_Skeleton should be at least 0!");
  146. }
  147. if (getSpawnedMobXpMultiplier() < 0) {
  148. reason.add("Experience.Gains.Mobspawners.Multiplier should be at least 0!");
  149. }
  150. if (getFormulaMultiplierCurve() < 0) {
  151. reason.add("Experience.Formula.Curve_Modifier should be at least 0!");
  152. }
  153. // Check if there were any errors
  154. if (noErrorsInConfig(reason)) {
  155. mcMMO.p.debug("No errors found in " + fileName + "!");
  156. }
  157. else {
  158. mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
  159. mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
  160. mcMMO.p.noErrorsInConfigFiles = false;
  161. }
  162. }
  163. /*
  164. * GENERAL SETTINGS
  165. */
  166. /* General Settings */
  167. public String getLocale() { return config.getString("General.Locale", "en_us"); }
  168. public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); }
  169. public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); }
  170. public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); }
  171. public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }
  172. public boolean getUpdateCheckEnabled() { return config.getBoolean("General.Update_Check", true); }
  173. public boolean getPreferBeta() { return config.getBoolean("General.Prefer_Beta", false); }
  174. public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); }
  175. public boolean getBackupsEnabled() { return config.getBoolean("General.Generate_Backups", true); }
  176. public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
  177. public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); }
  178. public String getPartyChatPrefix() { return config.getString("Commands.p.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); }
  179. public boolean getPartyChatColorLeaderName() { return config.getBoolean("Commands.p.Gold_Leader_Name", true); }
  180. public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", true); }
  181. public String getAdminChatPrefix() { return config.getString("Commands.a.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); }
  182. public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }
  183. /* Mob Healthbar */
  184. public MobHealthbarType getMobHealthbarDefault() {
  185. try {
  186. return MobHealthbarType.valueOf(config.getString("Mob_Healthbar.Display_Type", "HEARTS").toUpperCase().trim());
  187. }
  188. catch (IllegalArgumentException ex) {
  189. return MobHealthbarType.HEARTS;
  190. }
  191. }
  192. public int getMobHealthbarTime() { return config.getInt("Mob_Healthbar.Display_Time", 3); }
  193. /* Scoreboards */
  194. public boolean getMcrankScoreboardEnabled() { return config.getBoolean("Scoreboards.Mcrank.Use", true); }
  195. public int getMcrankScoreboardTime() { return config.getInt("Scoreboards.Mcrank.Display_Time", 10); }
  196. public boolean getMcstatsScoreboardsEnabled() { return config.getBoolean("Scoreboards.Mcstats.Use", true); }
  197. public int getMcstatsScoreboardTime() { return config.getInt("Scoreboards.Mcstats.Display_Time", 10); }
  198. public boolean getMctopScoreboardEnabled() { return config.getBoolean("Scoreboards.Mctop.Use", true); }
  199. public int getMctopScoreboardTime() { return config.getInt("Scoreboards.Mctop.Display_Time", 10); }
  200. public boolean getInspectScoreboardEnabled() { return config.getBoolean("Scoreboards.Inspect.Use", true); }
  201. public int getInspectScoreboardTime() { return config.getInt("Scoreboards.Inspect.Display_Time", 10); }
  202. public boolean getSkillScoreboardEnabled() { return config.getBoolean("Scoreboards.Skillname.Use", true); }
  203. public int getSkillScoreboardTime() { return config.getInt("Scoreboards.Skillname.Display_Time", 10); }
  204. public boolean getPowerLevelsEnabled() { return config.getBoolean("Scoreboards.Power_Level.Use", false); }
  205. /* Database Purging */
  206. public int getPurgeInterval() { return config.getInt("Database_Purging.Purge_Interval", -1); }
  207. public int getOldUsersCutoff() { return config.getInt("Database_Purging.Old_User_Cutoff", 6); }
  208. /* mySQL */
  209. public boolean getUseMySQL() { return config.getBoolean("MySQL.Enabled", false); }
  210. public String getMySQLTablePrefix() { return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); }
  211. public String getMySQLDatabaseName() { return getStringIncludingInts(config, "MySQL.Database.Name"); }
  212. public String getMySQLUserName() { return getStringIncludingInts(config, "MySQL.Database.User_Name"); }
  213. public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); }
  214. public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
  215. public String getMySQLUserPassword() {
  216. if (getStringIncludingInts(config, "MySQL.Database.User_Password") != null) {
  217. return getStringIncludingInts(config, "MySQL.Database.User_Password");
  218. }
  219. return "";
  220. }
  221. private static String getStringIncludingInts(ConfigurationSection cfg, String key) {
  222. String str = cfg.getString(key);
  223. if (str == null) {
  224. str = String.valueOf(cfg.getInt(key));
  225. }
  226. if (str.equals("0")) {
  227. str = "No value set for '" + key + "'";
  228. }
  229. return str;
  230. }
  231. /* Hardcore Mode */
  232. public boolean getHardcoreEnabled() { return config.getBoolean("Hardcore.Enabled", false); }
  233. public void setHardcoreEnabled(boolean enabled) { config.set("Hardcore.Enabled", enabled); }
  234. public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss_Penalty_Percentage", 75.0); }
  235. public void setHardcoreDeathStatPenaltyPercentage(double value) { config.set("Hardcore.Death_Stat_Loss_Penalty_Percentage", value); }
  236. public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism_Stat_Leech_Percentage", 5.0); }
  237. public void setHardcoreVampirismStatLeechPercentage(double value) { config.set("Hardcore.Vampirism_Stat_Leech_Percentage", value); }
  238. public boolean getHardcoreVampirismEnabled() { return config.getBoolean("Hardcore.Vampirism", false); }
  239. public void setHardcoreVampirismEnabled(boolean enabled) { config.set("Hardcore.Vampirism", enabled); }
  240. /* SMP Mods */
  241. public boolean getToolModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
  242. public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
  243. public boolean getBlockModsEnabled() { return config.getBoolean("Mods.Block_Mods_Enabled", false); }
  244. public boolean getEntityModsEnabled() { return config.getBoolean("Mods.Entity_Mods_Enabled", false); }
  245. /* Items */
  246. public int getChimaeraUseCost() { return config.getInt("Items.Chimaera_Wing.Use_Cost", 1); }
  247. public int getChimaeraRecipeCost() { return config.getInt("Items.Chimaera_Wing.Recipe_Cost", 5); }
  248. public int getChimaeraItemId() { return config.getInt("Items.Chimaera_Wing.Item_ID", 288); }
  249. public boolean getChimaeraEnabled() { return config.getBoolean("Items.Chimaera_Wing.Enabled", true); }
  250. public boolean getChimaeraPreventUseUnderground() { return config.getBoolean("Items.Chimaera_Wing.Prevent_Use_Underground", true); }
  251. public int getChimaeraCooldown() { return config.getInt("Items.Chimaera_Wing.Cooldown", 240); }
  252. public int getChimaeraWarmup() { return config.getInt("Items.Chimaera_Wing.Warmup", 5); }
  253. public int getChimaeraRecentlyHurtCooldown() { return config.getInt("Items.Chimaera_Wing.RecentlyHurt_Cooldown", 60); }
  254. /* Particles */
  255. public boolean getAbilityActivationEffectEnabled() { return config.getBoolean("Particles.Ability_Activation", true); }
  256. public boolean getAbilityDeactivationEffectEnabled() { return config.getBoolean("Particles.Ability_Deactivation", true); }
  257. public boolean getDodgeEffectEnabled() { return config.getBoolean("Particles.Dodge", true); }
  258. public boolean getBleedEffectEnabled() { return config.getBoolean("Particles.Bleed", true); }
  259. public boolean getGreaterImpactEffectEnabled() { return config.getBoolean("Particles.Greater_Impact", true); }
  260. public boolean getLevelUpEffectsEnabled() { return config.getBoolean("Particles.LevelUp_Enabled", true); }
  261. public int getLevelUpEffectsTier() { return config.getInt("Particles.LevelUp_Tier", 100); }
  262. public boolean getLargeFireworks() { return config.getBoolean("Particles.LargeFireworks", true); }
  263. /* PARTY SETTINGS */
  264. public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }
  265. public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); }
  266. public boolean getExpShareEnabled() { return config.getBoolean("Party.Sharing.ExpShare_enabled", true); }
  267. public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1); }
  268. public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05); }
  269. public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5); }
  270. public boolean getItemShareEnabled() { return config.getBoolean("Party.Sharing.ItemShare_enabled", true); }
  271. public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0); }
  272. /* Party Teleport Settings */
  273. public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 120); }
  274. public int getPTPCommandWarmup() { return config.getInt("Commands.ptp.Warmup", 5); }
  275. public int getPTPCommandRecentlyHurtCooldown() { return config.getInt("Commands.ptp.RecentlyHurt_Cooldown", 60); }
  276. public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); }
  277. public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); }
  278. public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); }
  279. /* Inspect command distance */
  280. public double getInspectDistance() { return config.getDouble("Commands.inspect.Max_Distance", 30); }
  281. /*
  282. * ABILITY SETTINGS
  283. */
  284. /* General Settings */
  285. public boolean getAbilityMessagesEnabled() { return config.getBoolean("Abilities.Messages", true); }
  286. public boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); }
  287. public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); }
  288. public int getCooldown(AbilityType ability) { return config.getInt("Abilities.Cooldowns." + ability.toString()); }
  289. public int getMaxTicks(AbilityType ability) { return config.getInt("Abilities.Max_Seconds." + ability.toString()); }
  290. /* Durability Settings */
  291. public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 2); }
  292. /* Thresholds */
  293. public int getTreeFellerThreshold() { return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); }
  294. /*
  295. * SKILL SETTINGS
  296. */
  297. public int getXp(SkillType skill, Material material) { return config.getInt("Experience." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
  298. public boolean getDoubleDropsEnabled(SkillType skill, Material material) { return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); }
  299. public boolean getDoubleDropsDisabled(SkillType skill) {
  300. String skillName = StringUtils.getCapitalized(skill.toString());
  301. ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName);
  302. Set<String> keys = section.getKeys(false);
  303. boolean disabled = true;
  304. for (String key : keys) {
  305. if (config.getBoolean("Double_Drops." + skillName + "." + key)) {
  306. disabled = false;
  307. break;
  308. }
  309. }
  310. return disabled;
  311. }
  312. /* Acrobatics */
  313. public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
  314. public boolean getPreventXPAfterTeleport() { return config.getBoolean("Skills.Acrobatics.Prevent_XP_After_Teleport", true); }
  315. /* Fishing */
  316. public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
  317. public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
  318. /* Mining */
  319. public int getDetonatorItemID() { return config.getInt("Skills.Mining.Detonator_ID", 259); }
  320. /* Repair */
  321. public double getRepairXPBase() { return config.getDouble("Experience.Repair.Base", 1000.0); }
  322. public double getRepairXP(RepairMaterialType repairMaterialType) { return config.getDouble("Experience.Repair." + StringUtils.getCapitalized(repairMaterialType.toString())); }
  323. public boolean getRepairAnvilMessagesEnabled() { return config.getBoolean("Skills.Repair.Anvil_Messages", true); }
  324. public int getRepairAnvilId() { return config.getInt("Skills.Repair.Anvil_ID", 42); }
  325. public int getSalvageAnvilId() { return config.getInt("Skills.Repair.Salvage_Anvil_ID", 41); }
  326. public boolean getSalvageTools() { return config.getBoolean("Skills.Repair.Salvage_tools", true); }
  327. public boolean getSalvageArmor() { return config.getBoolean("Skills.Repair.Salvage_armor", true); }
  328. public boolean getRepairConfirmRequired() { return config.getBoolean("Skills.Repair.Confirm_Required", true); }
  329. /* Unarmed */
  330. public boolean getUnarmedBlockCrackerSmoothbrickToCracked() { return config.getBoolean("Skills.Unarmed.Block_Cracker.SmoothBrick_To_CrackedBrick", true); }
  331. /* Taming */
  332. public int getTamingXPWolf() { return config.getInt("Experience.Taming.Animal_Taming.Wolf", 250); }
  333. public int getTamingXPOcelot() { return config.getInt("Experience.Taming.Animal_Taming.Ocelot", 500); }
  334. public int getTamingCOTWWolfCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Bones_Required", 10); }
  335. public int getTamingCOTWOcelotCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Fish_Required", 10); }
  336. public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40); }
  337. public int getTamingCOTWAmount(EntityType type) {
  338. switch (type) {
  339. case OCELOT:
  340. return config.getInt("Skills.Taming.Call_Of_The_Wild.Ocelot_Amount", 1);
  341. case WOLF:
  342. return config.getInt("Skills.Taming.Call_Of_The_Wild.Wolf_Amount", 1);
  343. default:
  344. return 1;
  345. }
  346. }
  347. /* Woodcutting */
  348. public int getWoodcuttingXPOak() { return config.getInt("Experience.Woodcutting.Oak", 70); }
  349. public int getWoodcuttingXPBirch() { return config.getInt("Experience.Woodcutting.Birch", 90); }
  350. public int getWoodcuttingXPSpruce() { return config.getInt("Experience.Woodcutting.Spruce", 80); }
  351. public int getWoodcuttingXPJungle() { return config.getInt("Experience.Woodcutting.Jungle", 100); }
  352. public int getWoodcuttingXPHugeBrownMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Brown", 70); }
  353. public int getWoodcuttingXPHugeRedMushroom() { return config.getInt("Experience.Woodcutting.Huge_Mushroom_Red", 70); }
  354. public boolean getOakDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Oak", true); }
  355. public boolean getBirchDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Birch", true); }
  356. public boolean getSpruceDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Spruce", true); }
  357. public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
  358. /* AFK Leveling */
  359. public boolean getAcrobaticsAFKDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
  360. public boolean getHerbalismAFKDisabled() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
  361. /* Level Caps */
  362. public int getPowerLevelCap() {
  363. int cap = config.getInt("General.Power_Level_Cap", 0);
  364. return (cap <= 0) ? Integer.MAX_VALUE : cap;
  365. }
  366. public int getLevelCap(SkillType skill) {
  367. int cap = config.getInt("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Level_Cap");
  368. return (cap <= 0) ? Integer.MAX_VALUE : cap;
  369. }
  370. /* PVP & PVE Settings */
  371. public boolean getPVPEnabled(SkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVP", true); }
  372. public boolean getPVEEnabled(SkillType skill) { return config.getBoolean("Skills." + StringUtils.getCapitalized(skill.toString()) + ".Enabled_For_PVE", true); }
  373. /*
  374. * XP SETTINGS
  375. */
  376. /* General Settings */
  377. public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience.PVP.Rewards", true); }
  378. public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience.Gains.Multiplier.Global", 1.0); }
  379. public void setExperienceGainsGlobalMultiplier(double value) { config.set("Experience.Gains.Multiplier.Global", value); }
  380. /* Combat XP Multipliers */
  381. public double getPlayerVersusPlayerXP() { return config.getDouble("Experience.Gains.Multiplier.PVP", 1.0); }
  382. public double getCombatXP(EntityType entity) { return config.getDouble("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); }
  383. public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); }
  384. public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); }
  385. public double getSpawnedMobXpMultiplier() { return config.getDouble("Experience.Gains.Mobspawners.Multiplier", 0.0); }
  386. /* XP Formula Multiplier */
  387. public int getFormulaMultiplierCurve() { return config.getInt("Experience.Formula.Curve_Modifier", 20); }
  388. public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience.Formula.Cumulative_Curve", false); }
  389. public double getFormulaSkillModifier(SkillType skill) { return config.getDouble("Experience.Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); }
  390. }