Config.java 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. package com.gmail.nossr50.config;
  2. import java.util.Set;
  3. import org.bukkit.configuration.ConfigurationSection;
  4. import com.gmail.nossr50.mcMMO;
  5. public class Config extends ConfigLoader {
  6. private static Config instance;
  7. private Config() {
  8. super("config.yml");
  9. loadKeys();
  10. }
  11. public static Config getInstance() {
  12. if (instance == null) {
  13. instance = new Config();
  14. }
  15. return instance;
  16. }
  17. @Override
  18. protected void loadKeys() {}
  19. /*
  20. * GENERAL SETTINGS
  21. */
  22. /* General Settings */
  23. public String getLocale() { return config.getString("General.Locale", "en_us"); }
  24. public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); }
  25. public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); }
  26. public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); }
  27. public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }
  28. public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); }
  29. public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", true); }
  30. public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }
  31. /* Database Purging */
  32. public int getPurgeInterval() { return config.getInt("Database_Purging.Purge_Interval", -1); }
  33. public int getOldUsersCutoff() { return config.getInt("Database_Purging.Old_User_Cutoff", 6); }
  34. /* mySQL */
  35. public boolean getUseMySQL() { return config.getBoolean("MySQL.Enabled", false); }
  36. public String getMySQLTablePrefix() { return config.getString("MySQL.Database.TablePrefix", "mcmmo_"); }
  37. public String getMySQLDatabaseName() { return getStringIncludingInts(config, "MySQL.Database.Name"); }
  38. public String getMySQLUserName() { return getStringIncludingInts(config, "MySQL.Database.User_Name"); }
  39. public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); }
  40. public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
  41. public String getMySQLUserPassword() {
  42. if (getStringIncludingInts(config, "MySQL.Database.User_Password") != null) {
  43. return getStringIncludingInts(config, "MySQL.Database.User_Password");
  44. }
  45. return "";
  46. }
  47. private static String getStringIncludingInts(ConfigurationSection cfg, String key) {
  48. String str = cfg.getString(key);
  49. if (str == null)
  50. str = String.valueOf(cfg.getInt(key));
  51. if (str == null)
  52. str = "No value set for '" + key + "'";
  53. return str;
  54. }
  55. /* Hardcore Mode */
  56. public boolean getHardcoreEnabled() { return config.getBoolean("Hardcore.Enabled", false); }
  57. public double getHardcoreDeathStatPenaltyPercentage() { return config.getDouble("Hardcore.Death_Stat_Loss_Penalty_Percentage", 75); }
  58. public double getHardcoreVampirismStatLeechPercentage() { return config.getDouble("Hardcore.Vampirism_Stat_Leech_Percentage", 5); }
  59. public boolean getHardcoreVampirismEnabled() { return config.getBoolean("Hardcore.Vampirism", false); }
  60. /* SMP Mods */
  61. public boolean getToolModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
  62. public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
  63. public boolean getBlockModsEnabled() { return config.getBoolean("Mods.Block_Mods_Enabled", false); }
  64. /* PARTY SETTINGS */
  65. public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }
  66. public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); }
  67. public boolean getPartyFriendlyFire() { return config.getBoolean("Party.FriendlyFire_Enabled", false); }
  68. public boolean getExpShareEnabled() { return config.getBoolean("Party.Sharing.ExpShare_enabled", true); }
  69. public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1); }
  70. public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05); }
  71. public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5); }
  72. public boolean getItemShareEnabled() { return config.getBoolean("Party.Sharing.ItemShare_enabled", true); }
  73. public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0); }
  74. /* Party Teleport Settings */
  75. public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 30); }
  76. public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); }
  77. public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); }
  78. public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); }
  79. /*
  80. * ABILITY SETTINGS
  81. */
  82. /* General Settings */
  83. public boolean getAbilityMessagesEnabled() { return config.getBoolean("Abilities.Messages", true); }
  84. public boolean getAbilitiesEnabled() { return config.getBoolean("Abilities.Enabled", true); }
  85. public boolean getAbilitiesOnlyActivateWhenSneaking() { return config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false); }
  86. /* Durability Settings */
  87. public boolean getAbilitiesDamageTools() { return config.getBoolean("Abilities.Tools.Durability_Loss_Enabled", true); }
  88. public int getAbilityToolDamage() { return config.getInt("Abilities.Tools.Durability_Loss", 2); }
  89. /* Cooldowns */
  90. public int getAbilityCooldownGreenTerra() { return config.getInt("Abilities.Cooldowns.Green_Terra", 240); }
  91. public int getAbilityCooldownSuperBreaker() { return config.getInt("Abilities.Cooldowns.Super_Breaker", 240); }
  92. public int getAbilityCooldownGigaDrillBreaker() { return config.getInt("Abilities.Cooldowns.Giga_Drill_Breaker", 240); }
  93. public int getAbilityCooldownTreeFeller() { return config.getInt("Abilities.Cooldowns.Tree_Feller", 240); }
  94. public int getAbilityCooldownBerserk() { return config.getInt("Abilities.Cooldowns.Berserk", 240); }
  95. public int getAbilityCooldownSerratedStrikes() { return config.getInt("Abilities.Cooldowns.Serrated_Strikes", 240); }
  96. public int getAbilityCooldownSkullSplitter() { return config.getInt("Abilities.Cooldowns.Skull_Splitter", 240); }
  97. public int getAbilityCooldownBlastMining() { return config.getInt("Abilities.Cooldowns.Blast_Mining", 60); }
  98. /* Max ticks */
  99. public int getAbilityMaxTicksGreenTerra() { return config.getInt("Abilities.Max_Seconds.Green_Terra", 0); }
  100. public int getAbilityMaxTicksSuperBreaker() { return config.getInt("Abilities.Max_Seconds.Super_Breaker", 0); }
  101. public int getAbilityMaxTicksGigaDrillBreaker() { return config.getInt("Abilities.Max_Seconds.Giga_Drill_Breaker", 0); }
  102. public int getAbilityMaxTicksTreeFeller() { return config.getInt("Abilities.Max_Seconds.Tree_Feller", 0); }
  103. public int getAbilityMaxTicksBerserk() { return config.getInt("Abilities.Max_Seconds.Berserk", 0); }
  104. public int getAbilityMaxTicksSerratedStrikes() { return config.getInt("Abilities.Max_Seconds.Serrated_Strikes", 0); }
  105. public int getAbilityMaxTicksSkullSplitter() { return config.getInt("Abilities.Max_Seconds.Skull_Splitter", 0); }
  106. public int getAbilityMaxTicksBlastMining() { return config.getInt("Abilities.Max_Seconds.Blast_Mining", 0); }
  107. /* Thresholds */
  108. public int getTreeFellerThreshold() { return config.getInt("Abilities.Limits.Tree_Feller_Threshold", 500); }
  109. /*
  110. * SKILL SETTINGS
  111. */
  112. /* Tool Requirements */
  113. public boolean getMiningRequiresTool() { return config.getBoolean("Skills.Mining.Requires_Pickaxe", true); }
  114. public boolean getExcavationRequiresTool() { return config.getBoolean("Skills.Excavation.Requires_Shovel", true); }
  115. public boolean getWoodcuttingRequiresTool() { return config.getBoolean("Skills.Woodcutting.Requires_Axe", true); }
  116. /* Excavation */
  117. public int getExcavationClayXP() { return config.getInt("Experience.Excavation.Clay", 40); }
  118. public int getExcavationDirtXP() { return config.getInt("Experience.Excavation.Dirt", 40); }
  119. public int getExcavationGrassXP() { return config.getInt("Experience.Excavation.Grass", 40); }
  120. public int getExcavationGravelXP() { return config.getInt("Experience.Excavation.Gravel", 40); }
  121. public int getExcavationMycelXP() { return config.getInt("Experience.Excavation.Mycel", 40); }
  122. public int getExcavationSandXP() { return config.getInt("Experience.Excavation.Sand", 40); }
  123. public int getExcavationSoulSandXP() { return config.getInt("Experience.Excavation.SoulSand", 40); }
  124. /* Fishing */
  125. public int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); }
  126. public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
  127. /* Herbalism */
  128. public int getHerbalismXPSugarCane() { return config.getInt("Experience.Herbalism.Sugar_Cane", 30); }
  129. public int getHerbalismXPWheat() { return config.getInt("Experience.Herbalism.Wheat", 50); }
  130. public int getHerbalismXPCactus() { return config.getInt("Experience.Herbalism.Cactus", 30); }
  131. public int getHerbalismXPPumpkin() { return config.getInt("Experience.Herbalism.Pumpkin", 20); }
  132. public int getHerbalismXPFlowers() { return config.getInt("Experience.Herbalism.Flowers", 100); }
  133. public int getHerbalismXPMushrooms() { return config.getInt("Experience.Herbalism.Mushrooms", 150); }
  134. public int getHerbalismXPMelon() { return config.getInt("Experience.Herbalism.Melon", 20); }
  135. public int getHerbalismXPNetherWart() { return config.getInt("Experience.Herbalism.Nether_Wart", 50); }
  136. public int getHerbalismXPLilyPads() { return config.getInt("Experience.Herbalism.Lily_Pads", 100); }
  137. public int getHerbalismXPVines() { return config.getInt("Experience.Herbalism.Vines", 10); }
  138. public int getHerbalismXPCocoa() { return config.getInt("Experience.Herbalism.Cocoa", 30); }
  139. public int getHerbalismXPCarrot() { return config.getInt("Experience.Herbalism.Carrot", 50); }
  140. public int getHerbalismXPPotato() { return config.getInt("Experience.Herbalism.Potato", 50); }
  141. public boolean getHerbalismGreenThumbCobbleToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); }
  142. public boolean getHerbalismGreenThumbCobbleWallToMossyWall() { return config.getBoolean("Skills.Herbalism.Green_Thumb.CobbleWall_To_MossyWall", true); }
  143. public boolean getHerbalismGreenThumbSmoothbrickToMossy() { return config.getBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); }
  144. public boolean getHerbalismGreenThumbDirtToGrass() { return config.getBoolean("Skills.Herbalism.Green_Thumb.Dirt_To_Grass", true); }
  145. public boolean getBrownMushroomsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Brown_Mushrooms", true); }
  146. public boolean getCactiDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Cacti", true); }
  147. public boolean getWheatDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Wheat", true); }
  148. public boolean getMelonsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Melons", true); }
  149. public boolean getNetherWartsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Nether_Warts", true); }
  150. public boolean getPumpkinsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Pumpkins", true); }
  151. public boolean getRedMushroomsDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Red_Mushrooms", true); }
  152. public boolean getRedRosesDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Red_Roses", true); }
  153. public boolean getSugarCaneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Sugar_Cane", true); }
  154. public boolean getVinesDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Vines", true); }
  155. public boolean getWaterLiliesDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Water_Lilies", true); }
  156. public boolean getYellowFlowersDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Yellow_Flowers", true); }
  157. public boolean getCocoaDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Cocoa", true); }
  158. public boolean getCarrotDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Carrot", true); }
  159. public boolean getPotatoDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Potato", true); }
  160. public boolean herbalismDoubleDropsDisabled() {
  161. return doubleDropsDisabled("Herbalism");
  162. }
  163. /* Mining */
  164. public int getMiningXPGoldOre() { return config.getInt("Experience.Mining.Gold", 250); }
  165. public int getMiningXPDiamondOre() { return config.getInt("Experience.Mining.Diamond", 750); }
  166. public int getMiningXPIronOre() { return config.getInt("Experience.Mining.Iron", 250); }
  167. public int getMiningXPRedstoneOre() { return config.getInt("Experience.Mining.Redstone", 150); }
  168. public int getMiningXPLapisOre() { return config.getInt("Experience.Mining.Lapis", 400); }
  169. public int getMiningXPObsidian() { return config.getInt("Experience.Mining.Obsidian", 150); }
  170. public int getMiningXPNetherrack() { return config.getInt("Experience.Mining.Netherrack", 30); }
  171. public int getMiningXPGlowstone() { return config.getInt("Experience.Mining.Glowstone", 30); }
  172. public int getMiningXPCoalOre() { return config.getInt("Experience.Mining.Coal", 100); }
  173. public int getMiningXPStone() { return config.getInt("Experience.Mining.Stone", 30); }
  174. public int getMiningXPSandstone() { return config.getInt("Experience.Mining.Sandstone", 30); }
  175. public int getMiningXPEndStone() { return config.getInt("Experience.Mining.End_Stone", 150); }
  176. public int getMiningXPMossyStone() { return config.getInt("Experience.Mining.Moss_Stone", 30); }
  177. public int getMiningXPEmeraldOre() { return config.getInt("Experience.Mining.Emerald", 1000); }
  178. public boolean getCoalDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Coal", true); }
  179. public boolean getDiamondDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Diamond", true); }
  180. public boolean getEndStoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.End_Stone", true); }
  181. public boolean getGlowstoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Glowstone", true); }
  182. public boolean getGoldDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Gold", true); }
  183. public boolean getIronDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Iron", true); }
  184. public boolean getLapisDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Lapis", true); }
  185. public boolean getMossyCobblestoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Moss_Stone", true); }
  186. public boolean getNetherrackDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Netherrack", true); }
  187. public boolean getObsidianDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Obsidian", true); }
  188. public boolean getRedstoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Redstone", true); }
  189. public boolean getSandstoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Sandstone", true); }
  190. public boolean getStoneDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Stone", true); }
  191. public boolean getEmeraldDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Emerald", true); }
  192. public boolean miningDoubleDropsDisabled() {
  193. return doubleDropsDisabled("Mining");
  194. }
  195. public int getDetonatorItemID() { return config.getInt("Skills.Mining.Detonator_ID", 259); }
  196. /* Repair */
  197. public boolean getRepairAnvilMessagesEnabled() { return config.getBoolean("Skills.Repair.Anvil_Messages", true); }
  198. public int getRepairAnvilId() { return config.getInt("Skills.Repair.Anvil_ID", 42); }
  199. public boolean getSalvageEnabled() { return config.getBoolean("Skills.Repair.Salvage_enabled", true); }
  200. public int getSalvageAnvilId() { return config.getInt("Skills.Repair.Salvage_Anvil_ID", 41); }
  201. public int getSalvageUnlockLevel() { return config.getInt("Skills.Repair.Salvage_UnlockLevel", 600); }
  202. public boolean getSalvageTools() { return config.getBoolean("Skills.Repair.Salvage_tools", true); }
  203. public boolean getSalvageArmor() { return config.getBoolean("Skills.Repair.Salvage_armor", true); }
  204. /* Smelting */
  205. public int getSmeltingXPCoal() { return config.getInt("Experience.Smelting.Coal", 10); }
  206. public int getSmeltingXPRedstone() { return config.getInt("Experience.Smelting.Redstone", 15); }
  207. public int getSmeltingXPIron() { return config.getInt("Experience.Smelting.Iron", 25); }
  208. public int getSmeltingXPGold() { return config.getInt("Experience.Smelting.Gold", 35); }
  209. public int getSmeltingXPDiamond() { return config.getInt("Experience.Smelting.Diamond", 75); }
  210. public int getSmeltingXPLapis() { return config.getInt("Experience.Smelting.Lapis", 40); }
  211. public int getSmeltingXPEmerald() { return config.getInt("Experience.Smelting.Emerald", 100); }
  212. /* Taming */
  213. public int getTamingXPWolf() { return config.getInt("Experience.Taming.Animal_Taming.Wolf", 250); }
  214. public int getTamingXPOcelot() { return config.getInt("Experience.Taming.Animal_Taming.Ocelot", 500); }
  215. public int getTamingCOTWWolfCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Bones_Required", 10); }
  216. public int getTamingCOTWOcelotCost() { return config.getInt("Skills.Taming.Call_Of_The_Wild.Fish_Required", 10); }
  217. /* Woodcutting */
  218. public int getWoodcuttingXPOak() { return config.getInt("Experience.Woodcutting.Oak", 70); }
  219. public int getWoodcuttingXPBirch() { return config.getInt("Experience.Woodcutting.Birch", 90); }
  220. public int getWoodcuttingXPSpruce() { return config.getInt("Experience.Woodcutting.Spruce", 80); }
  221. public int getWoodcuttingXPJungle() { return config.getInt("Experience.Woodcutting.Jungle", 100); }
  222. public boolean getOakDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Oak", true); }
  223. public boolean getBirchDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Birch", true); }
  224. public boolean getSpruceDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Spruce", true); }
  225. public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
  226. public boolean woodcuttingDoubleDropsDisabled() {
  227. return doubleDropsDisabled("Woodcutting");
  228. }
  229. /* AFK Leveling */
  230. public boolean getAcrobaticsAFKDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_AFK_Leveling", true); }
  231. public boolean getHerbalismAFKDisabled() { return config.getBoolean("Skills.Herbalism.Prevent_AFK_Leveling", true); }
  232. /* Dogde Lightning */
  233. public boolean getDodgeLightningDisabled() { return config.getBoolean("Skills.Acrobatics.Prevent_Dodge_Lightning", false); }
  234. /* Level Caps */
  235. public int getLevelCapAcrobatics() {
  236. return getLevelCap("Skills.Acrobatics.Level_Cap");
  237. }
  238. public int getLevelCapArchery() {
  239. return getLevelCap("Skills.Archery.Level_Cap");
  240. }
  241. public int getLevelCapAxes() {
  242. return getLevelCap("Skills.Axes.Level_Cap");
  243. }
  244. public int getLevelCapExcavation() {
  245. return getLevelCap("Skills.Excavation.Level_Cap");
  246. }
  247. public int getLevelCapFishing() {
  248. return getLevelCap("Skills.Fishing.Level_Cap");
  249. }
  250. public int getLevelCapHerbalism() {
  251. return getLevelCap("Skills.Herbalism.Level_Cap");
  252. }
  253. public int getLevelCapMining() {
  254. return getLevelCap("Skills.Mining.Level_Cap");
  255. }
  256. public int getLevelCapRepair() {
  257. return getLevelCap("Skills.Repair.Level_Cap");
  258. }
  259. public int getLevelCapSmelting() {
  260. return getLevelCap("Skills.Smelting.Level_Cap");
  261. }
  262. public int getLevelCapSwords() {
  263. return getLevelCap("Skills.Swords.Level_Cap");
  264. }
  265. public int getLevelCapTaming() {
  266. return getLevelCap("Skills.Taming.Level_Cap");
  267. }
  268. public int getLevelCapUnarmed() {
  269. return getLevelCap("Skills.Unarmed.Level_Cap");
  270. }
  271. public int getLevelCapWoodcutting() {
  272. return getLevelCap("Skills.Woodcutting.Level_Cap");
  273. }
  274. public int getPowerLevelCap() {
  275. return getLevelCap("General.Power_Level_Cap");
  276. }
  277. /* PVP & PVE Settings */
  278. public boolean getAcrobaticsPVP() { return config.getBoolean("Skills.Acrobatics.Enabled_For_PVP", true); }
  279. public boolean getAcrobaticsPVE() { return config.getBoolean("Skills.Acrobatics.Enabled_For_PVE", true); }
  280. public boolean getArcheryPVP() { return config.getBoolean("Skills.Archery.Enabled_For_PVP", true); }
  281. public boolean getArcheryPVE() { return config.getBoolean("Skills.Archery.Enabled_For_PVE", true); }
  282. public boolean getAxesPVP() { return config.getBoolean("Skills.Axes.Enabled_For_PVP", true); }
  283. public boolean getAxesPVE() { return config.getBoolean("Skills.Axes.Enabled_For_PVE", true); }
  284. public boolean getSwordsPVP() { return config.getBoolean("Skills.Swords.Enabled_For_PVP", true); }
  285. public boolean getSwordsPVE() { return config.getBoolean("Skills.Swords.Enabled_For_PVE", true); }
  286. public boolean getTamingPVP() { return config.getBoolean("Skills.Taming.Enabled_For_PVP", true); }
  287. public boolean getTamingPVE() { return config.getBoolean("Skills.Taming.Enabled_For_PVE", true); }
  288. public boolean getUnarmedPVP() { return config.getBoolean("Skills.Unarmed.Enabled_For_PVP", true); }
  289. public boolean getUnarmedPVE() { return config.getBoolean("Skills.Unarmed.Enabled_For_PVE", true); }
  290. /*
  291. * XP SETTINGS
  292. */
  293. /* General Settings */
  294. public boolean getExperienceGainsMobspawnersEnabled() { return config.getBoolean("Experience.Gains.Mobspawners.Enabled", false); }
  295. public boolean getExperienceGainsPlayerVersusPlayerEnabled() { return config.getBoolean("Experience.PVP.Rewards", true); }
  296. public double getExperienceGainsGlobalMultiplier() { return config.getDouble("Experience.Gains.Multiplier.Global", 1.0); }
  297. public void setExperienceGainsGlobalMultiplier(double value) { config.set("Experience.Gains.Multiplier.Global", value); }
  298. /* Combat XP Multipliers */
  299. public double getPlayerVersusPlayerXP() { return config.getDouble("Experience.Gains.Multiplier.PVP", 1.0); }
  300. public double getAnimalsXP() { return config.getDouble("Experience.Combat.Multiplier.Animals", 1.0); }
  301. public double getCreeperXP() { return config.getDouble("Experience.Combat.Multiplier.Creeper", 4.0); }
  302. public double getSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Skeleton", 2.0); }
  303. public double getSpiderXP() { return config.getDouble("Experience.Combat.Multiplier.Spider", 3.0); }
  304. public double getGhastXP() { return config.getDouble("Experience.Combat.Multiplier.Ghast", 3.0); }
  305. public double getSlimeXP() { return config.getDouble("Experience.Combat.Multiplier.Slime", 2.0); }
  306. public double getZombieXP() { return config.getDouble("Experience.Combat.Multiplier.Zombie", 2.0); }
  307. public double getPigZombieXP() { return config.getDouble("Experience.Combat.Multiplier.Pig_Zombie", 3.0); }
  308. public double getEndermanXP() { return config.getDouble("Experience.Combat.Multiplier.Enderman", 2.0); }
  309. public double getCaveSpiderXP() { return config.getDouble("Experience.Combat.Multiplier.Cave_Spider", 3.0); }
  310. public double getSilverfishXP() { return config.getDouble("Experience.Combat.Multiplier.Silverfish", 3.0); }
  311. public double getBlazeXP() { return config.getDouble("Experience.Combat.Multiplier.Blaze", 3.0); }
  312. public double getMagmaCubeXP() { return config.getDouble("Experience.Combat.Multiplier.Magma_Cube", 2.0); }
  313. public double getEnderDragonXP() { return config.getDouble("Experience.Combat.Multiplier.Ender_Dragon", 8.0); }
  314. public double getIronGolemXP() { return config.getDouble("Experience.Combat.Multiplier.Iron_Golem", 2.0); }
  315. public double getGiantXP() { return config.getDouble("Experience.Combat.Multiplier.Giant", 4.0); }
  316. public double getWitherXP() { return config.getDouble("Experience.Combat.Multiplier.Wither", 7.0); }
  317. public double getWitherSkeletonXP() { return config.getDouble("Experience.Combat.Multiplier.Wither_Skeleton", 4.0); }
  318. public double getWitchXP() { return config.getDouble("Experience.Combat.Multiplier.Witch", 4.0); }
  319. /* XP Formula Multiplier */
  320. public int getFormulaMultiplierCurve() { return config.getInt("Experience.Formula.Curve_Modifier", 20); }
  321. public double getFormulaMultiplierTaming() { return config.getDouble("Experience.Formula.Multiplier.Taming", 1.0); }
  322. public double getFormulaMultiplierMining() { return config.getDouble("Experience.Formula.Multiplier.Mining", 1.0); }
  323. public double getFormulaMultiplierRepair() { return config.getDouble("Experience.Formula.Multiplier.Repair", 1.0); }
  324. public double getFormulaMultiplierWoodcutting() { return config.getDouble("Experience.Formula.Multiplier.Woodcutting", 1.0); }
  325. public double getFormulaMultiplierUnarmed() { return config.getDouble("Experience.Formula.Multiplier.Unarmed", 1.0); }
  326. public double getFormulaMultiplierHerbalism() { return config.getDouble("Experience.Formula.Multiplier.Herbalism", 1.0); }
  327. public double getFormulaMultiplierExcavation() { return config.getDouble("Experience.Formula.Multiplier.Excavation", 1.0); }
  328. public double getFormulaMultiplierArchery() { return config.getDouble("Experience.Formula.Multiplier.Archery", 1.0); }
  329. public double getFormulaMultiplierSwords() { return config.getDouble("Experience.Formula.Multiplier.Swords", 1.0); }
  330. public double getFormulaMultiplierAxes() { return config.getDouble("Experience.Formula.Multiplier.Axes", 1.0); }
  331. public double getFormulaMultiplierAcrobatics() { return config.getDouble("Experience.Formula.Multiplier.Acrobatics", 1.0); }
  332. public double getFormulaMultiplierFishing() { return config.getDouble("Experience.Formula.Multiplier.Fishing", 1.0); }
  333. private boolean doubleDropsDisabled(String skillName) {
  334. ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName);
  335. if (section == null) {
  336. mcMMO.p.getLogger().warning("The configuration files are outdated!"); //TODO Locale and more descriptive message!
  337. return false;
  338. }
  339. Set<String> keys = section.getKeys(false);
  340. boolean disabled = true;
  341. for (String key : keys) {
  342. if (config.getBoolean("Double_Drops." + skillName + "." + key)) {
  343. disabled = false;
  344. break;
  345. }
  346. }
  347. return disabled;
  348. }
  349. private int getLevelCap(String configString) {
  350. int cap = config.getInt(configString, 0);
  351. return ((cap <= 0) ? Integer.MAX_VALUE : cap);
  352. }
  353. }