Config.java 25 KB

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