2
0

MainConfig.java 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
  1. package com.gmail.nossr50.config;
  2. import com.gmail.nossr50.datatypes.MobHealthbarType;
  3. import com.gmail.nossr50.datatypes.party.PartyFeature;
  4. import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
  5. import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
  6. import com.gmail.nossr50.mcMMO;
  7. import com.gmail.nossr50.util.StringUtils;
  8. import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
  9. import org.bukkit.Material;
  10. import org.bukkit.block.data.BlockData;
  11. import org.bukkit.entity.EntityType;
  12. import java.util.ArrayList;
  13. import java.util.List;
  14. @ConfigSerializable
  15. public class MainConfig extends ConfigValidated {
  16. public static final String METRICS = "Metrics";
  17. public static final String BSTATS = "bstats";
  18. public static final String GENERAL = "General";
  19. public static final String RETRO_MODE = "RetroMode";
  20. public static final String ENABLED = "Enabled";
  21. public static final String LOCALE = "Locale";
  22. public static final String EN_US = "en_us";
  23. public static final String MOTD = "MOTD_";
  24. public static final String SHOW_PROFILE_LOADED = "Show_Profile_Loaded";
  25. public static final String DONATE_MESSAGE = "Donate_Message";
  26. public static final String MCMMO = "mcmmo";
  27. public static final String DATABASE_PREFIX = MCMMO + "_";
  28. public static final String COMMANDS = "Commands";
  29. public static final String SAVE_INTERVAL = "Save_Interval";
  30. public static final String STATS = "Stats";
  31. public static final String STATS_TRACKING = STATS + "_Tracking";
  32. public static final String UPDATE_CHECK = "Update_Check";
  33. public static final String PREFER_BETA = "Prefer_Beta";
  34. public static final String VERBOSE_LOGGING = "Verbose_Logging";
  35. public static final String PARTYCHAT = "partychat";
  36. public static final String CHAT_PREFIX_FORMAT = "Chat_Prefix_Format";
  37. public static final String NAME = "Name";
  38. public static final String GOLD_LEADER_NAME = "Gold_Leader_" + NAME;
  39. public static final String USE_DISPLAY_NAMES = "Use_Display_" + NAME + "s";
  40. public static final String ALLY = "_Ally";
  41. public static final String ADMINCHAT = "adminchat";
  42. public static final String GENERIC = "Generic";
  43. public static final String MATCH_OFFLINE_PLAYERS = "Match_OfflinePlayers";
  44. public static final String DATABASE = "Database";
  45. public static final String COOLDOWN = "Cooldown";
  46. public static final String PLAYER_COOLDOWN = "Player_" + COOLDOWN;
  47. public static final String LEVEL_UP = "LevelUp_";
  48. public static final String SOUND = "Sound";
  49. public static final String LEVEL_UP_SOUNDS = "LevelUp_Sounds";
  50. public static final String REFRESH_CHUNKS = "Refresh_Chunks";
  51. public static final String MOB_HEALTHBAR = "Mob_Healthbar";
  52. public static final String DISPLAY_TYPE = "Display_Type";
  53. public static final String HEARTS = "HEARTS";
  54. public static final String DISPLAY_TIME = "Display_Time";
  55. public static final String SCOREBOARD = "ConfigScoreboard";
  56. public static final String USE_SCOREBOARDS = "UseScoreboards";
  57. public static final String POWER = "Power_";
  58. public static final String POWER_LEVEL_TAGS = POWER + "Level_Tags";
  59. public static final String KEEP = "Keep";
  60. public static final String ALLOW_KEEP = "Allow_" + KEEP;
  61. public static final String TIPS_AMOUNT = "Tips_Amount";
  62. public static final String SHOW_STATS_AFTER_LOGIN = "Show_" + STATS + "_After_Login";
  63. public static final String RAINBOWS = "Rainbows";
  64. public static final String ABILITY_NAMES = "Ability_" + NAME + "s";
  65. public static final String TYPES = "Types";
  66. public static final String RANK = "Rank";
  67. public static final String PRINT = "Print";
  68. public static final String BOARD = "Board";
  69. public static final String TOP = "Top";
  70. public static final String INSPECT = "Inspect";
  71. public static final String SKILL = "Skill";
  72. public static final String TIME = "Time";
  73. public static final String PURGING = "_Purging";
  74. public static final String PURGE_INTERVAL = "Purge_Interval";
  75. public static final String OLD_USER_CUTOFF = "Old_User_Cutoff";
  76. public static final String BACKUPS = "Backups";
  77. public static final String KEEP_LAST_24_HOURS = KEEP + ".Last_24_Hours";
  78. public static final String DAILY_LAST_WEEK = "Daily_Last_Week";
  79. public static final String WEEKLY_PAST_MONTHS = "Weekly_Past_Months";
  80. public static final String MY_SQL = "MySQL";
  81. public static final String TABLE_PREFIX = "TablePrefix";
  82. public static final String USER_NAME = "User_" + NAME;
  83. public static final String SERVER = "Server";
  84. public static final String PORT = "Port";
  85. public static final String ADDRESS = "Address";
  86. public static final String LOCALHOST = "localhost";
  87. public static final String USER_PASSWORD = "User_Password";
  88. public static final String MAX_CONNECTIONS = "MaxConnections";
  89. public static final String MAX_POOL_SIZE = "MaxPoolSize";
  90. public static final String SSL = "SSL";
  91. public static final String HARDCORE = "Hardcore";
  92. public static final String DEATH_STAT_LOSS = "Death_Stat_Loss";
  93. public static final String PENALTY_PERCENTAGE = "Penalty_Percentage";
  94. public static final String LEVEL_THRESHOLD = "Level_Threshold";
  95. public static final String VAMPIRISM = "Vampirism";
  96. public static final String LEECH_PERCENTAGE = "Leech_Percentage";
  97. public static final String ITEMS = "Items";
  98. public static final String CHIMAERA_WING = "Chimaera_Wing";
  99. public static final String USE_COST = "Use_Cost";
  100. public static final String RECIPE_COST = "Recipe_Cost";
  101. public static final String ITEM = "Item_";
  102. public static final String FEATHER = "Feather";
  103. public static final String PREVENT = "Prevent_";
  104. public static final String PREVENT_USE_UNDERGROUND = PREVENT + "Use_Underground";
  105. public static final String USE_BED_SPAWN = "Use_Bed_Spawn";
  106. public static final String WARMUP = "Warmup";
  107. public static final String RECENTLY_HURT = "RecentlyHurt_";
  108. public static final String PARTICLES = "Particles";
  109. public static final String ACTIVATION = "Activation";
  110. public static final String ABILITY_ACTIVATION = "Ability_" + ACTIVATION;
  111. public static final String ABILITY_DEACTIVATION = "Ability_Deactivation";
  112. public static final String BLEED = "Bleed";
  113. public static final String DODGE = "Dodge";
  114. public static final String FLUX = "Flux";
  115. public static final String GREATER_IMPACT = "Greater_Impact";
  116. public static final String CALL_OF_THE_WILD = "Call_of_the_Wild";
  117. public static final String TIER = "Tier";
  118. public static final String LARGE_FIREWORKS = "LargeFireworks";
  119. public static final String PARTY = "Party";
  120. public static final String FRIENDLY_FIRE = "FriendlyFire";
  121. public static final String MAX_SIZE = "MaxSize";
  122. public static final String AUTO_KICK_INTERVAL = "AutoKick_Interval";
  123. public static final String OLD_PARTY_MEMBER_CUTOFF = "Old_Party_Member_Cutoff";
  124. public static final String SHARING = "Sharing";
  125. public static final String SHARING_EXP_SHARE_BONUS_BASE = SHARING + "ExpShare_bonus_base";
  126. public static final String EXP_SHARE_BONUS_INCREASE = "ExpShare_bonus_increase";
  127. public static final String EXP_SHARE_BONUS_CAP = "ExpShare_bonus_cap";
  128. public static final String RANGE = "Range";
  129. public static final String LEVELING = "Leveling";
  130. public static final String LEVEL_CAP = "Level_Cap";
  131. public static final String XP_CURVE_MODIFIER = "Xp_Curve_Modifier";
  132. public static final String NEAR_MEMBERS_NEEDED = "Near_Members_Needed";
  133. public static final String INFORM_ALL_PARTY_MEMBERS_ON_LEVEL_UP = "Inform_All_Party_Members_On_LevelUp";
  134. public static final String UNLOCK_LEVEL = "_UnlockLevel";
  135. public static final String PTP = "ptp";
  136. public static final String ACCEPT_REQUIRED = "Accept_Required";
  137. public static final String REQUEST_TIMEOUT = "Request_Timeout";
  138. public static final String WORLD_BASED_PERMISSIONS = "World_Based_Permissions";
  139. public static final String INSPECT1 = "inspect";
  140. public static final String MAX_DISTANCE = "Max_Distance";
  141. public static final String SKILLS = "Skills";
  142. public static final String URL_LINKS = "URL_Links";
  143. public static final String ABILITIES = "Abilities";
  144. public static final String MESSAGES = "Messages";
  145. public static final String ONLY_ACTIVATE_WHEN_SNEAKING = "Only_Activate_When_Sneaking";
  146. public static final String LEVEL_GATE_ABILITIES = "Level_Gate_Abilities";
  147. public static final String COOLDOWNS = "Cooldowns";
  148. public static final String MAX_SECONDS = "Max_Seconds";
  149. public static final String TOOLS = "Tools";
  150. public static final String DURABILITY_LOSS = "Durability_Loss";
  151. public static final String LIMITS = "Limits";
  152. public static final String TREE_FELLER = "Tree_Feller_";
  153. public static final String TREE_FELLER_THRESHOLD = TREE_FELLER + "Threshold";
  154. public static final String DOUBLE_DROPS = "Double_Drops";
  155. public static final String AXES = "Axes";
  156. public static final String TRUNCATE = "Truncate";
  157. public static final String FOR_PVP = "_For_PVP";
  158. public static final String FOR_PVE = "_For_PVE";
  159. public static final String ACROBATICS = "Acrobatics";
  160. public static final String PREVENT_AFK = PREVENT + "AFK_";
  161. public static final String WOODCUTTING = "Woodcutting";
  162. public static final String SOUNDS = "Sounds";
  163. public static final String MAX_TRIES_AT_SAME_LOCATION = "Max_Tries_At_Same_Location";
  164. public static final String HERBALISM = "Herbalism";
  165. public static final String TAMING = "Taming";
  166. public static final String CALL_OF_THE_WILD1 = "Call_Of_The_Wild";
  167. public static final String SUMMON_AMOUNT = "Summon_Amount";
  168. public static final String SUMMON_LENGTH = "Summon_Length";
  169. public static final String SUMMON_MAX_AMOUNT = "Summon_Max_Amount";
  170. public static final String AMOUNT = "Amount";
  171. public static final String MATERIAL = "Material";
  172. public static final String REPAIR = "Repair";
  173. public static final String CONFIRM_REQUIRED = "Confirm_Required";
  174. public static final String ANVIL = "Anvil_";
  175. public static final String ANVIL_MATERIAL = ANVIL + "Material";
  176. public static final String IRON_BLOCK = "IRON_BLOCK";
  177. public static final String ANVIL_USE = ANVIL + "Use_";
  178. public static final String ANVIL_PLACED = ANVIL + "Placed_";
  179. public static final String SALVAGE = "Salvage";
  180. public static final String UNARMED = "Unarmed";
  181. public static final String BLOCK_CRACKER = "Block_Cracker";
  182. public static final String SMOOTH_BRICK_TO_CRACKED_BRICK = "SmoothBrick_To_CrackedBrick";
  183. public static final String PICKUP_DISABLED_FULL_INVENTORY = "Pickup_Disabled_Full_Inventory";
  184. public static final String AS = "_As_";
  185. public static final String MINING = "Mining";
  186. public static final String DETONATOR = "Detonator_";
  187. public static final String FLINT_AND_STEEL = "FLINT_AND_STEEL";
  188. public static final String FISHING = "Fishing";
  189. public static final String LURE_MODIFIER = "Lure_Modifier";
  190. public static final String EXTRA_FISH = "Extra_Fish";
  191. public static final String OVERRIDE_VANILLA_TREASURES = "Override_Vanilla_Treasures";
  192. public static final String DROPS = "Drops_";
  193. public static final String ALCHEMY = "Alchemy";
  194. public static final String PREVENT_HOPPER_TRANSFER_BOTTLES = PREVENT + "Hopper_Transfer_Bottles";
  195. public static final String PREVENT_HOPPER_TRANSFER_INGREDIENTS = PREVENT + "Hopper_Transfer_Ingredients";
  196. public static final String FOR_HOPPERS = "_for_Hoppers";
  197. public static final String XP_AFTER_TELEPORT = "XP_After_Teleport_";
  198. public static final String LIGHTNING = "_Lightning";
  199. public static final String GOLD_BLOCK = "GOLD_BLOCK";
  200. public static final String PICKAXE = "_Pickaxe";
  201. public static final String EXP_SHARE_BONUS_BASE = "ExpShare_bonus_base";
  202. public MainConfig() {
  203. //super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "config.yml", true);
  204. super("main", mcMMO.p.getDataFolder().getAbsoluteFile(), ConfigConstants.RELATIVE_PATH_CONFIG_DIR, true, true, true, true);
  205. }
  206. /**
  207. * This grabs an instance of this config class from the Config Manager
  208. * This method is deprecated and will be removed in the future
  209. * @see mcMMO#getConfigManager()
  210. * @return the instance of this config
  211. * @deprecated Please use mcMMO.getConfigManager() to grab a specific config instead
  212. */
  213. @Deprecated
  214. public static MainConfig getInstance() {
  215. return mcMMO.getConfigManager().getMainConfig();
  216. }
  217. @Override
  218. public void unload() {
  219. //do nothing
  220. }
  221. /**
  222. * The version of this config
  223. *
  224. * @return
  225. */
  226. @Override
  227. public double getConfigVersion() {
  228. return 1;
  229. }
  230. @Override
  231. public List<String> validateKeys() {
  232. // Validate all the settings!
  233. List<String> reason = new ArrayList<String>();
  234. /* General Settings */
  235. if (getSaveInterval() <= 0) {
  236. reason.add(GENERAL + SAVE_INTERVAL + " should be greater than 0!");
  237. }
  238. /* MySQL Settings */
  239. /*for (SQLDatabaseManager.PoolIdentifier identifier : SQLDatabaseManager.PoolIdentifier.values()) {
  240. if (getMySQLMaxConnections(identifier) <= 0) {
  241. reason.add(MY_SQL + "." + DATABASE + "." + MAX_CONNECTIONS + "." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!");
  242. }
  243. if (getMySQLMaxPoolSize(identifier) <= 0) {
  244. reason.add(MY_SQL + "." + DATABASE + "." + MAX_POOL_SIZE + "." + StringUtils.getCapitalized(identifier.toString()) + " should be greater than 0!");
  245. }
  246. }*/
  247. /* Mob Healthbar */
  248. if (getMobHealthbarTime() == 0) {
  249. reason.add(MOB_HEALTHBAR + "." + DISPLAY_TIME + " cannot be 0! Set to -1 to disable or set a valid value.");
  250. }
  251. /* Scoreboards */
  252. /*if (getRankScoreboardTime() != -1 && getRankScoreboardTime() <= 0) {
  253. reason.add("ConfigScoreboard.Types.Rank.Display_Time should be greater than 0, or -1!");
  254. }
  255. if (getStatsScoreboardTime() != -1 && getStatsScoreboardTime() <= 0) {
  256. reason.add("ConfigScoreboard.Types.Stats.Display_Time should be greater than 0, or -1!");
  257. }
  258. if (getTopScoreboardTime() != -1 && getTopScoreboardTime() <= 0) {
  259. reason.add("ConfigScoreboard.Types.Top.Display_Time should be greater than 0, or -1!");
  260. }
  261. if (getInspectScoreboardTime() != -1 && getInspectScoreboardTime() <= 0) {
  262. reason.add("ConfigScoreboard.Types.Inspect.Display_Time should be greater than 0, or -1!");
  263. }
  264. if (getSkillScoreboardTime() != -1 && getSkillScoreboardTime() <= 0) {
  265. reason.add("ConfigScoreboard.Types.Skill.Display_Time should be greater than 0, or -1!");
  266. }
  267. if (getSkillLevelUpTime() != -1 && getSkillScoreboardTime() <= 0) {
  268. reason.add("ConfigScoreboard.Types.Skill.Display_Time should be greater than 0, or -1!");
  269. }
  270. if (!(getRankUseChat() || getRankUseBoard())) {
  271. reason.add("Either Board or Print in ConfigScoreboard.Types.Rank must be true!");
  272. }
  273. if (!(getTopUseChat() || getTopUseBoard())) {
  274. reason.add("Either Board or Print in ConfigScoreboard.Types.Top must be true!");
  275. }
  276. if (!(getStatsUseChat() || getStatsUseBoard())) {
  277. reason.add("Either Board or Print in ConfigScoreboard.Types.Stats must be true!");
  278. }
  279. if (!(getInspectUseChat() || getInspectUseBoard())) {
  280. reason.add("Either Board or Print in ConfigScoreboard.Types.Inspect must be true!");
  281. }*/
  282. /* Database Purging */
  283. if (getPurgeInterval() < -1) {
  284. reason.add(DATABASE + PURGING + "." + PURGE_INTERVAL + " should be greater than, or equal to -1!");
  285. }
  286. if (getOldUsersCutoff() != -1 && getOldUsersCutoff() <= 0) {
  287. reason.add(DATABASE + PURGING + "." + OLD_USER_CUTOFF + " should be greater than 0 or -1!");
  288. }
  289. /* Hardcore Mode */
  290. if (getHardcoreDeathStatPenaltyPercentage() < 0.01 || getHardcoreDeathStatPenaltyPercentage() > 100) {
  291. reason.add(HARDCORE + "." + DEATH_STAT_LOSS + "." + PENALTY_PERCENTAGE + " only accepts values from 0.01 to 100!");
  292. }
  293. if (getHardcoreVampirismStatLeechPercentage() < 0.01 || getHardcoreVampirismStatLeechPercentage() > 100) {
  294. reason.add(HARDCORE + "." + VAMPIRISM + "." + LEECH_PERCENTAGE + " only accepts values from 0.01 to 100!");
  295. }
  296. /* Items */
  297. if (getChimaeraUseCost() < 1 || getChimaeraUseCost() > 64) {
  298. reason.add(ITEMS + "." + CHIMAERA_WING + "." + USE_COST + " only accepts values from 1 to 64!");
  299. }
  300. if (getChimaeraRecipeCost() < 1 || getChimaeraRecipeCost() > 9) {
  301. reason.add(ITEMS + "." + CHIMAERA_WING + "." + RECIPE_COST + " only accepts values from 1 to 9!");
  302. }
  303. if (getChimaeraItem() == null) {
  304. reason.add(ITEMS + "." + CHIMAERA_WING + "." + ITEM + NAME + " is invalid!");
  305. }
  306. /* Particles */
  307. if (getLevelUpEffectsTier() < 1) {
  308. reason.add(PARTICLES + "." + LEVEL_UP + "Tier should be at least 1!");
  309. }
  310. /* PARTY SETTINGS */
  311. if (getAutoPartyKickInterval() < -1) {
  312. reason.add(PARTY + "." + AUTO_KICK_INTERVAL + " should be at least -1!");
  313. }
  314. if (getAutoPartyKickTime() < 0) {
  315. reason.add(PARTY + "." + OLD_PARTY_MEMBER_CUTOFF + " should be at least 0!");
  316. }
  317. if (getPartyShareBonusBase() <= 0) {
  318. reason.add(PARTY + "." + SHARING_EXP_SHARE_BONUS_BASE + " should be greater than 0!");
  319. }
  320. if (getPartyShareBonusIncrease() < 0) {
  321. reason.add(PARTY + "." + SHARING + "." + EXP_SHARE_BONUS_INCREASE + " should be at least 0!");
  322. }
  323. if (getPartyShareBonusCap() <= 0) {
  324. reason.add(PARTY + "." + SHARING + "." + EXP_SHARE_BONUS_CAP + " should be greater than 0!");
  325. }
  326. if (getPartyShareRange() <= 0) {
  327. reason.add(PARTY + "." + SHARING + "." + RANGE + " should be greater than 0!");
  328. }
  329. if (getPartyXpCurveMultiplier() < 1) {
  330. reason.add(PARTY + "." + LEVELING + "." + XP_CURVE_MODIFIER + " should be at least 1!");
  331. }
  332. for (PartyFeature partyFeature : PartyFeature.values()) {
  333. if (getPartyFeatureUnlockLevel(partyFeature) < 0) {
  334. reason.add(PARTY + "." + LEVELING + "." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + "_UnlockLevel should be at least 0!");
  335. }
  336. }
  337. /* Inspect command distance */
  338. if (getInspectDistance() <= 0) {
  339. reason.add(COMMANDS + "." + INSPECT1 + "." + MAX_DISTANCE + " should be greater than 0!");
  340. }
  341. if (getTreeFellerThreshold() <= 0) {
  342. reason.add(ABILITIES + "." + LIMITS + "." + TREE_FELLER_THRESHOLD + " should be greater than 0!");
  343. }
  344. if (getFishingLureModifier() < 0) {
  345. reason.add(ABILITIES + "." + FISHING + "." + LURE_MODIFIER + " should be at least 0!");
  346. }
  347. if (getDetonatorItem() == null) {
  348. reason.add(SKILLS + "." + MINING + "." + DETONATOR + "Item is invalid!");
  349. }
  350. if (getRepairAnvilMaterial() == null) {
  351. reason.add(SKILLS + "." + REPAIR + "." + ANVIL + "Type is invalid!!");
  352. }
  353. if (getSalvageAnvilMaterial() == null) {
  354. reason.add(SKILLS + "." + REPAIR + "." + SALVAGE + "_" + ANVIL + "Type is invalid!");
  355. }
  356. if (getRepairAnvilMaterial() == getSalvageAnvilMaterial()) {
  357. reason.add("Cannot use the same item for " + REPAIR + " and " + SALVAGE + " anvils!");
  358. }
  359. if (getTamingCOTWMaterial(EntityType.WOLF) == null) {
  360. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Wolf." + ITEM + "Material is invalid!!");
  361. }
  362. if (getTamingCOTWMaterial(EntityType.OCELOT) == null) {
  363. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Ocelot." + ITEM + "Material is invalid!!");
  364. }
  365. if (getTamingCOTWMaterial(EntityType.HORSE) == null) {
  366. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Horse." + ITEM + "Material is invalid!!");
  367. }
  368. if (getTamingCOTWCost(EntityType.WOLF) <= 0) {
  369. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Wolf." + ITEM + "Amount should be greater than 0!");
  370. }
  371. if (getTamingCOTWCost(EntityType.OCELOT) <= 0) {
  372. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Ocelot." + ITEM + "Amount should be greater than 0!");
  373. }
  374. if (getTamingCOTWCost(EntityType.HORSE) <= 0) {
  375. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Horse." + ITEM + "Amount should be greater than 0!");
  376. }
  377. if (getTamingCOTWAmount(EntityType.WOLF) <= 0) {
  378. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Wolf." + SUMMON_AMOUNT + " should be greater than 0!");
  379. }
  380. if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) {
  381. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Ocelot." + SUMMON_AMOUNT + " should be greater than 0!");
  382. }
  383. if (getTamingCOTWAmount(EntityType.HORSE) <= 0) {
  384. reason.add(SKILLS + "." + TAMING + "." + CALL_OF_THE_WILD1 + ".Horse." + SUMMON_AMOUNT + " should be greater than 0!");
  385. }
  386. return reason;
  387. }
  388. /*
  389. * GENERAL SETTINGS
  390. */
  391. /* General Settings */
  392. public boolean getIsMetricsEnabled() {
  393. return getBooleanValue(METRICS, BSTATS);
  394. }
  395. //Retro mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install)
  396. public boolean getIsRetroMode() {
  397. return getBooleanValue(GENERAL, RETRO_MODE, ENABLED);
  398. }
  399. public String getLocale() {
  400. if(hasNode(GENERAL, LOCALE))
  401. return getStringValue(GENERAL, LOCALE);
  402. else
  403. return "en_US";
  404. }
  405. public boolean getMOTDEnabled() {
  406. return getBooleanValue(GENERAL, MOTD + ENABLED);
  407. }
  408. public boolean getShowProfileLoadedMessage() {
  409. return getBooleanValue(GENERAL, SHOW_PROFILE_LOADED);
  410. }
  411. public boolean getDonateMessageEnabled() {
  412. return getBooleanValue(COMMANDS, MCMMO, DONATE_MESSAGE);
  413. }
  414. public int getSaveInterval() {
  415. return getIntValue(GENERAL, SAVE_INTERVAL);
  416. }
  417. public String getPartyChatPrefix() {
  418. return getStringValue(COMMANDS, PARTYCHAT, CHAT_PREFIX_FORMAT);
  419. }
  420. public boolean getPartyChatColorLeaderName() {
  421. return getBooleanValue(COMMANDS, PARTYCHAT, GOLD_LEADER_NAME);
  422. }
  423. public boolean getPartyDisplayNames() {
  424. return getBooleanValue(COMMANDS, PARTYCHAT, USE_DISPLAY_NAMES);
  425. }
  426. public String getPartyChatPrefixAlly() {
  427. return getStringValue(COMMANDS, PARTYCHAT, CHAT_PREFIX_FORMAT + ALLY);
  428. }
  429. public String getAdminChatPrefix() {
  430. return getStringValue(COMMANDS, ADMINCHAT, CHAT_PREFIX_FORMAT);
  431. }
  432. public boolean getAdminDisplayNames() {
  433. return getBooleanValue(COMMANDS, ADMINCHAT, USE_DISPLAY_NAMES);
  434. }
  435. public boolean getMatchOfflinePlayers() {
  436. return getBooleanValue(COMMANDS, GENERIC, MATCH_OFFLINE_PLAYERS);
  437. }
  438. public long getDatabasePlayerCooldown() {
  439. return getLongValue(COMMANDS, DATABASE, PLAYER_COOLDOWN);
  440. }
  441. public boolean getLevelUpSoundsEnabled() {
  442. return getBooleanValue(GENERAL, LEVEL_UP_SOUNDS);
  443. }
  444. public boolean getRefreshChunksEnabled() {
  445. return getBooleanValue(GENERAL, REFRESH_CHUNKS);
  446. }
  447. public boolean getMobHealthbarEnabled() {
  448. return getBooleanValue(MOB_HEALTHBAR, ENABLED);
  449. }
  450. /* Mob Healthbar */
  451. public MobHealthbarType getMobHealthbarDefault() {
  452. try {
  453. return MobHealthbarType.valueOf(getStringValue(MOB_HEALTHBAR, DISPLAY_TYPE, HEARTS).toUpperCase().trim());
  454. } catch (IllegalArgumentException ex) {
  455. return MobHealthbarType.HEARTS;
  456. }
  457. }
  458. public int getMobHealthbarTime() {
  459. return getIntValue(MOB_HEALTHBAR, DISPLAY_TIME);
  460. }
  461. /* Scoreboards */
  462. public boolean getScoreboardsEnabled() {
  463. return getBooleanValue(SCOREBOARD, USE_SCOREBOARDS);
  464. }
  465. public boolean getRankUseChat() {
  466. return getBooleanValue(SCOREBOARD, TYPES, RANK, PRINT);
  467. }
  468. public boolean getRankUseBoard() {
  469. return getBooleanValue(SCOREBOARD, TYPES, RANK, BOARD);
  470. }
  471. public int getRankScoreboardTime() {
  472. return getIntValue(SCOREBOARD, TYPES, RANK, DISPLAY_TIME);
  473. }
  474. public boolean getTopUseChat() {
  475. return getBooleanValue(SCOREBOARD, TYPES, TOP, PRINT);
  476. }
  477. public boolean getTopUseBoard() {
  478. return getBooleanValue(SCOREBOARD, TYPES, TOP, BOARD);
  479. }
  480. public int getTopScoreboardTime() {
  481. return getIntValue(SCOREBOARD, TYPES, TOP, DISPLAY_TIME);
  482. }
  483. public boolean getStatsUseChat() {
  484. return getBooleanValue(SCOREBOARD, TYPES, STATS, PRINT);
  485. }
  486. public boolean getStatsUseBoard() {
  487. return getBooleanValue(SCOREBOARD, TYPES, STATS, BOARD);
  488. }
  489. public int getStatsScoreboardTime() {
  490. return getIntValue(SCOREBOARD, TYPES, STATS, DISPLAY_TIME);
  491. }
  492. public boolean getInspectUseChat() {
  493. return getBooleanValue(SCOREBOARD, TYPES, INSPECT, PRINT);
  494. }
  495. public boolean getInspectUseBoard() {
  496. return getBooleanValue(SCOREBOARD, TYPES, INSPECT, BOARD);
  497. }
  498. public int getInspectScoreboardTime() {
  499. return getIntValue(SCOREBOARD, TYPES, INSPECT, DISPLAY_TIME);
  500. }
  501. public boolean getCooldownUseChat() {
  502. return getBooleanValue(SCOREBOARD, TYPES, COOLDOWN, PRINT);
  503. }
  504. public boolean getCooldownUseBoard() {
  505. return getBooleanValue(SCOREBOARD, TYPES, COOLDOWN, BOARD);
  506. }
  507. public int getCooldownScoreboardTime() {
  508. return getIntValue(SCOREBOARD, TYPES, COOLDOWN, DISPLAY_TIME);
  509. }
  510. public boolean getSkillUseBoard() {
  511. return getBooleanValue(SCOREBOARD, TYPES, SKILL, BOARD);
  512. }
  513. public int getSkillScoreboardTime() {
  514. return getIntValue(SCOREBOARD, TYPES, SKILL, DISPLAY_TIME);
  515. }
  516. public boolean getSkillLevelUpBoard() {
  517. return getBooleanValue(SCOREBOARD, TYPES, SKILL, LEVEL_UP + BOARD);
  518. }
  519. public int getSkillLevelUpTime() {
  520. return getIntValue(SCOREBOARD, TYPES, SKILL, LEVEL_UP + TIME);
  521. }
  522. /* Database Purging */
  523. public int getPurgeInterval() {
  524. return getIntValue(DATABASE + PURGING, PURGE_INTERVAL);
  525. }
  526. public int getOldUsersCutoff() {
  527. return getIntValue(DATABASE + PURGING, OLD_USER_CUTOFF);
  528. }
  529. /* Backups */
  530. public boolean getBackupsEnabled() {
  531. return getBooleanValue(BACKUPS, ENABLED);
  532. }
  533. public boolean getKeepLast24Hours() {
  534. return getBooleanValue(BACKUPS, KEEP_LAST_24_HOURS);
  535. }
  536. public boolean getKeepDailyLastWeek() {
  537. return getBooleanValue(BACKUPS, KEEP, DAILY_LAST_WEEK);
  538. }
  539. public boolean getKeepWeeklyPastMonth() {
  540. return getBooleanValue(BACKUPS, KEEP, WEEKLY_PAST_MONTHS);
  541. }
  542. /* mySQL */
  543. /*public boolean getUseMySQL() {
  544. return getBooleanValue(MY_SQL, ENABLED);
  545. }
  546. public String getMySQLTablePrefix() {
  547. return getStringValue(MY_SQL, DATABASE, TABLE_PREFIX, DATABASE_PREFIX);
  548. }
  549. public String getMySQLDatabaseName() {
  550. return getStringValue(MY_SQL, DATABASE, NAME);
  551. }
  552. public String getMySQLUserName() {
  553. return getStringValue(MY_SQL, DATABASE, USER_NAME);
  554. }
  555. public int getMySQLServerPort() {
  556. return getIntValue(MY_SQL, SERVER, PORT);
  557. }
  558. public String getMySQLServerName() {
  559. return getStringValue(MY_SQL, SERVER, ADDRESS, LOCALHOST);
  560. }
  561. public String getMySQLUserPassword() {
  562. return getStringValue(MY_SQL, DATABASE, USER_PASSWORD);
  563. }
  564. public int getMySQLMaxConnections(SQLDatabaseManager.PoolIdentifier identifier) {
  565. return getIntValue(MY_SQL, DATABASE, MAX_CONNECTIONS, StringUtils.getCapitalized(identifier.toString()));
  566. }
  567. public int getMySQLMaxPoolSize(SQLDatabaseManager.PoolIdentifier identifier) {
  568. return getIntValue(MY_SQL, DATABASE, MAX_POOL_SIZE, StringUtils.getCapitalized(identifier.toString()));
  569. }
  570. public boolean getMySQLSSL() {
  571. return getBooleanValue(MY_SQL, SERVER, SSL);
  572. }*/
  573. //TODO: Legit cannot tell what the point of this method was
  574. /*ssadprivate String getStringIncludingInts(String[] key) {
  575. String str = getStringValue(key);
  576. if (str == null) {
  577. str = String.valueOf(getIntValue(key));
  578. }
  579. if (str.equals("0")) {
  580. str = "No value set for '" + key + "'";
  581. }
  582. return str;
  583. }*/
  584. /* Hardcore Mode */
  585. public boolean getHardcoreStatLossEnabled(PrimarySkillType primarySkillType) {
  586. return getBooleanValue(HARDCORE, DEATH_STAT_LOSS, ENABLED, StringUtils.getCapitalized(primarySkillType.toString()));
  587. }
  588. public double getHardcoreDeathStatPenaltyPercentage() {
  589. return getDoubleValue(HARDCORE, DEATH_STAT_LOSS, PENALTY_PERCENTAGE);
  590. }
  591. public int getHardcoreDeathStatPenaltyLevelThreshold() {
  592. return getIntValue(HARDCORE, DEATH_STAT_LOSS, LEVEL_THRESHOLD);
  593. }
  594. public boolean getHardcoreVampirismEnabled(PrimarySkillType primarySkillType) {
  595. return getBooleanValue(HARDCORE, VAMPIRISM, ENABLED, StringUtils.getCapitalized(primarySkillType.toString()));
  596. }
  597. public double getHardcoreVampirismStatLeechPercentage() {
  598. return getDoubleValue(HARDCORE, VAMPIRISM, LEECH_PERCENTAGE);
  599. }
  600. public int getHardcoreVampirismLevelThreshold() {
  601. return getIntValue(HARDCORE, VAMPIRISM, LEVEL_THRESHOLD);
  602. }
  603. /* Items */
  604. public int getChimaeraUseCost() {
  605. return getIntValue(ITEMS, CHIMAERA_WING, USE_COST);
  606. }
  607. public int getChimaeraRecipeCost() {
  608. return getIntValue(ITEMS, CHIMAERA_WING, RECIPE_COST);
  609. }
  610. public Material getChimaeraItem() {
  611. return Material.matchMaterial(getStringValue(ITEMS, CHIMAERA_WING, ITEM + NAME));
  612. }
  613. public boolean getChimaeraEnabled() {
  614. return getBooleanValue(ITEMS, CHIMAERA_WING, ENABLED);
  615. }
  616. public boolean getChimaeraPreventUseUnderground() {
  617. return getBooleanValue(ITEMS, CHIMAERA_WING, PREVENT_USE_UNDERGROUND);
  618. }
  619. public boolean getChimaeraUseBedSpawn() {
  620. return getBooleanValue(ITEMS, CHIMAERA_WING, USE_BED_SPAWN);
  621. }
  622. public int getChimaeraCooldown() {
  623. return getIntValue(ITEMS, CHIMAERA_WING, COOLDOWN);
  624. }
  625. public int getChimaeraWarmup() {
  626. return getIntValue(ITEMS, CHIMAERA_WING, WARMUP);
  627. }
  628. public int getChimaeraRecentlyHurtCooldown() {
  629. return getIntValue(ITEMS, CHIMAERA_WING, RECENTLY_HURT + COOLDOWN);
  630. }
  631. public boolean getChimaeraSoundEnabled() {
  632. return getBooleanValue(ITEMS, CHIMAERA_WING, SOUND + "_" + ENABLED);
  633. }
  634. public boolean getFluxPickaxeSoundEnabled() {
  635. return getBooleanValue(ITEMS, FLUX + PICKAXE, SOUND + "_" + ENABLED);
  636. }
  637. /* Particles */
  638. public boolean getAbilityActivationEffectEnabled() {
  639. return getBooleanValue(PARTICLES, ABILITY_ACTIVATION);
  640. }
  641. public boolean getAbilityDeactivationEffectEnabled() {
  642. return getBooleanValue(PARTICLES, ABILITY_DEACTIVATION);
  643. }
  644. public boolean getBleedEffectEnabled() {
  645. return getBooleanValue(PARTICLES, BLEED);
  646. }
  647. public boolean getDodgeEffectEnabled() {
  648. return getBooleanValue(PARTICLES, DODGE);
  649. }
  650. public boolean getFluxEffectEnabled() {
  651. return getBooleanValue(PARTICLES, FLUX);
  652. }
  653. public boolean getGreaterImpactEffectEnabled() {
  654. return getBooleanValue(PARTICLES, GREATER_IMPACT);
  655. }
  656. public boolean getCallOfTheWildEffectEnabled() {
  657. return getBooleanValue(PARTICLES, CALL_OF_THE_WILD);
  658. }
  659. public boolean getLevelUpEffectsEnabled() {
  660. return getBooleanValue(PARTICLES, LEVEL_UP + ENABLED);
  661. }
  662. public int getLevelUpEffectsTier() {
  663. return getIntValue(PARTICLES, LEVEL_UP + TIER);
  664. }
  665. public boolean getLargeFireworks() {
  666. return getBooleanValue(PARTICLES, LARGE_FIREWORKS);
  667. }
  668. /* PARTY SETTINGS */
  669. public boolean getPartyFriendlyFire() {
  670. return getBooleanValue(PARTY, FRIENDLY_FIRE);
  671. }
  672. public int getPartyMaxSize() {
  673. return getIntValue(PARTY, MAX_SIZE);
  674. }
  675. public int getAutoPartyKickInterval() {
  676. return getIntValue(PARTY, AUTO_KICK_INTERVAL);
  677. }
  678. public int getAutoPartyKickTime() {
  679. return getIntValue(PARTY, OLD_PARTY_MEMBER_CUTOFF);
  680. }
  681. public double getPartyShareBonusBase() {
  682. return getDoubleValue(PARTY, SHARING, EXP_SHARE_BONUS_BASE);
  683. }
  684. public double getPartyShareBonusIncrease() {
  685. return getDoubleValue(PARTY, SHARING, EXP_SHARE_BONUS_INCREASE);
  686. }
  687. public double getPartyShareBonusCap() {
  688. return getDoubleValue(PARTY, SHARING, EXP_SHARE_BONUS_CAP);
  689. }
  690. public double getPartyShareRange() {
  691. return getDoubleValue(PARTY, SHARING, RANGE);
  692. }
  693. public int getPartyLevelCap() {
  694. int cap = getIntValue(PARTY, LEVELING, LEVEL_CAP);
  695. return (cap <= 0) ? Integer.MAX_VALUE : cap;
  696. }
  697. //TODO: Move this to Experience Config
  698. public int getPartyXpCurveMultiplier() {
  699. return getIntValue(PARTY, LEVELING, XP_CURVE_MODIFIER);
  700. }
  701. public boolean getPartyXpNearMembersNeeded() {
  702. return getBooleanValue(PARTY, LEVELING, NEAR_MEMBERS_NEEDED);
  703. }
  704. public boolean getPartyInformAllMembers() {
  705. return getBooleanValue(PARTY, LEVELING, INFORM_ALL_PARTY_MEMBERS_ON_LEVEL_UP);
  706. }
  707. public int getPartyFeatureUnlockLevel(PartyFeature partyFeature) {
  708. return getIntValue(PARTY, LEVELING, StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", "") + UNLOCK_LEVEL);
  709. }
  710. /* Party Teleport Settings */
  711. public int getPTPCommandCooldown() {
  712. return getIntValue(COMMANDS, PTP, COOLDOWN);
  713. }
  714. public int getPTPCommandWarmup() {
  715. return getIntValue(COMMANDS, PTP, WARMUP);
  716. }
  717. public int getPTPCommandRecentlyHurtCooldown() {
  718. return getIntValue(COMMANDS, PTP, RECENTLY_HURT + COOLDOWN);
  719. }
  720. public int getPTPCommandTimeout() {
  721. return getIntValue(COMMANDS, PTP, REQUEST_TIMEOUT);
  722. }
  723. public boolean getPTPCommandConfirmRequired() {
  724. return getBooleanValue(COMMANDS, PTP, ACCEPT_REQUIRED);
  725. }
  726. public boolean getPTPCommandWorldPermissions() {
  727. return getBooleanValue(COMMANDS, PTP, WORLD_BASED_PERMISSIONS);
  728. }
  729. /* Inspect command distance */
  730. public double getInspectDistance() {
  731. return getDoubleValue(COMMANDS, INSPECT1, MAX_DISTANCE);
  732. }
  733. /*
  734. * ABILITY SETTINGS
  735. */
  736. /* General Settings */
  737. public boolean getUrlLinksEnabled() {
  738. return getBooleanValue(COMMANDS, SKILLS, URL_LINKS);
  739. }
  740. public boolean getAbilityMessagesEnabled() {
  741. return getBooleanValue(ABILITIES, MESSAGES);
  742. }
  743. public boolean getAbilitiesEnabled() {
  744. return getBooleanValue(ABILITIES, ENABLED);
  745. }
  746. public boolean getAbilitiesOnlyActivateWhenSneaking() {
  747. return getBooleanValue(ABILITIES, ACTIVATION, ONLY_ACTIVATE_WHEN_SNEAKING);
  748. }
  749. public int getCooldown(SuperAbilityType ability) {
  750. return getIntValue(ABILITIES, COOLDOWNS + ability.toString());
  751. }
  752. public int getMaxLength(SuperAbilityType ability) {
  753. return getIntValue(ABILITIES, MAX_SECONDS, ability.toString());
  754. }
  755. /* Durability Settings */
  756. public int getAbilityToolDamage() {
  757. return getIntValue(ABILITIES, TOOLS, DURABILITY_LOSS);
  758. }
  759. /* Thresholds */
  760. public int getTreeFellerThreshold() {
  761. return getIntValue(ABILITIES, LIMITS, TREE_FELLER_THRESHOLD);
  762. }
  763. /*
  764. * SKILL SETTINGS
  765. */
  766. public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) {
  767. return getBooleanValue(DOUBLE_DROPS, StringUtils.getCapitalized(skill.toString()), StringUtils.getPrettyItemString(material).replace(" ", "_"));
  768. }
  769. /* Acrobatics */
  770. public boolean getDodgeLightningDisabled() {
  771. return getBooleanValue(SKILLS, ACROBATICS, PREVENT + DODGE + LIGHTNING);
  772. }
  773. public int getXPAfterTeleportCooldown() {
  774. return getIntValue(SKILLS, ACROBATICS, XP_AFTER_TELEPORT + COOLDOWN);
  775. }
  776. /* Alchemy */
  777. public boolean getEnabledForHoppers() {
  778. return getBooleanValue(SKILLS, ALCHEMY, ENABLED + FOR_HOPPERS);
  779. }
  780. public boolean getPreventHopperTransferIngredients() {
  781. return getBooleanValue(SKILLS, ALCHEMY, PREVENT_HOPPER_TRANSFER_INGREDIENTS);
  782. }
  783. public boolean getPreventHopperTransferBottles() {
  784. return getBooleanValue(SKILLS, ALCHEMY, PREVENT_HOPPER_TRANSFER_BOTTLES);
  785. }
  786. /* Fishing */
  787. public boolean getFishingDropsEnabled() {
  788. return getBooleanValue(SKILLS, FISHING, DROPS + ENABLED);
  789. }
  790. public boolean getFishingOverrideTreasures() {
  791. return getBooleanValue(SKILLS, FISHING, OVERRIDE_VANILLA_TREASURES);
  792. }
  793. public boolean getFishingExtraFish() {
  794. return getBooleanValue(SKILLS, FISHING, EXTRA_FISH);
  795. }
  796. public double getFishingLureModifier() {
  797. return getDoubleValue(SKILLS, FISHING, LURE_MODIFIER);
  798. }
  799. /* Mining */
  800. public Material getDetonatorItem() {
  801. //Flint and steel
  802. return Material.matchMaterial(getStringValue(SKILLS, MINING, DETONATOR + NAME));
  803. }
  804. /* Repair */
  805. public boolean getRepairAnvilMessagesEnabled() {
  806. return getBooleanValue(SKILLS, REPAIR, ANVIL + MESSAGES);
  807. }
  808. public boolean getRepairAnvilPlaceSoundsEnabled() {
  809. return getBooleanValue(SKILLS, REPAIR, ANVIL_PLACED + SOUNDS);
  810. }
  811. public boolean getRepairAnvilUseSoundsEnabled() {
  812. return getBooleanValue(SKILLS, REPAIR, ANVIL_USE + SOUNDS);
  813. }
  814. public Material getRepairAnvilMaterial() {
  815. //Iron block
  816. return Material.matchMaterial(getStringValue(SKILLS, REPAIR, ANVIL_MATERIAL));
  817. }
  818. public boolean getRepairConfirmRequired() {
  819. return getBooleanValue(SKILLS, REPAIR, CONFIRM_REQUIRED);
  820. }
  821. /* Salvage */
  822. public boolean getSalvageAnvilMessagesEnabled() {
  823. return getBooleanValue(SKILLS, SALVAGE, ANVIL + MESSAGES);
  824. }
  825. public boolean getSalvageAnvilPlaceSoundsEnabled() {
  826. return getBooleanValue(SKILLS, SALVAGE, ANVIL_PLACED + SOUNDS);
  827. }
  828. public boolean getSalvageAnvilUseSoundsEnabled() {
  829. return getBooleanValue(SKILLS, SALVAGE, ANVIL_USE + SOUNDS);
  830. }
  831. public Material getSalvageAnvilMaterial() {
  832. //Gold Block
  833. return Material.matchMaterial(getStringValue(SKILLS, SALVAGE, ANVIL_MATERIAL));
  834. }
  835. public boolean getSalvageConfirmRequired() {
  836. return getBooleanValue(SKILLS, SALVAGE, CONFIRM_REQUIRED);
  837. }
  838. /* Unarmed */
  839. public boolean getUnarmedBlockCrackerSmoothbrickToCracked() {
  840. return getBooleanValue(SKILLS, UNARMED, BLOCK_CRACKER, SMOOTH_BRICK_TO_CRACKED_BRICK);
  841. }
  842. public boolean getUnarmedItemPickupDisabled() {
  843. return getBooleanValue(SKILLS, UNARMED, ITEM + PICKUP_DISABLED_FULL_INVENTORY);
  844. }
  845. public boolean getUnarmedItemsAsUnarmed() {
  846. return getBooleanValue(SKILLS, UNARMED, ITEMS + AS + UNARMED);
  847. }
  848. /* Taming */
  849. public Material getTamingCOTWMaterial(EntityType type) {
  850. return Material.matchMaterial(getStringValue(SKILLS, TAMING, CALL_OF_THE_WILD1, StringUtils.getPrettyEntityTypeString(type), ITEM + MATERIAL));
  851. }
  852. public int getTamingCOTWCost(EntityType type) {
  853. return getIntValue(SKILLS, TAMING, CALL_OF_THE_WILD1, StringUtils.getPrettyEntityTypeString(type), ITEM + AMOUNT);
  854. }
  855. public int getTamingCOTWAmount(EntityType type) {
  856. return getIntValue(SKILLS, TAMING, CALL_OF_THE_WILD1, StringUtils.getPrettyEntityTypeString(type), SUMMON_AMOUNT);
  857. }
  858. public int getTamingCOTWLength(EntityType type) {
  859. return getIntValue(SKILLS, TAMING, CALL_OF_THE_WILD1, StringUtils.getPrettyEntityTypeString(type), SUMMON_LENGTH);
  860. }
  861. public int getTamingCOTWMaxAmount(EntityType type) {
  862. return getIntValue(SKILLS, TAMING, CALL_OF_THE_WILD1, StringUtils.getPrettyEntityTypeString(type), SUMMON_MAX_AMOUNT);
  863. }
  864. public double getTamingCOTWRange() {
  865. return getDoubleValue(SKILLS, TAMING, CALL_OF_THE_WILD1, RANGE);
  866. }
  867. /* Woodcutting */
  868. public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) {
  869. return getBooleanValue(DOUBLE_DROPS, WOODCUTTING, StringUtils.getFriendlyConfigBlockDataString(material));
  870. }
  871. public boolean getTreeFellerSoundsEnabled() {
  872. return getBooleanValue(SKILLS, WOODCUTTING, TREE_FELLER + SOUNDS);
  873. }
  874. /* AFK Leveling */
  875. public boolean getAcrobaticsPreventAFK() {
  876. return getBooleanValue(SKILLS, ACROBATICS, PREVENT_AFK + LEVELING);
  877. }
  878. public int getAcrobaticsAFKMaxTries() {
  879. return getIntValue(SKILLS, ACROBATICS, MAX_TRIES_AT_SAME_LOCATION);
  880. }
  881. public boolean getHerbalismPreventAFK() {
  882. return getBooleanValue(SKILLS, HERBALISM, PREVENT_AFK + LEVELING);
  883. }
  884. /* Level Caps */
  885. public int getPowerLevelCap() {
  886. int cap = getIntValue(GENERAL, POWER + LEVEL_CAP);
  887. return (cap <= 0) ? Integer.MAX_VALUE : cap;
  888. }
  889. public int getLevelCap(PrimarySkillType skill) {
  890. int cap = getIntValue(SKILLS, StringUtils.getCapitalized(skill.toString()), LEVEL_CAP);
  891. return (cap <= 0) ? Integer.MAX_VALUE : cap;
  892. }
  893. public boolean getTruncateSkills() {
  894. return getBooleanValue(GENERAL, TRUNCATE + SKILLS);
  895. }
  896. /* PVP & PVE Settings */
  897. public boolean getPVPEnabled(PrimarySkillType skill) {
  898. return getBooleanValue(SKILLS, StringUtils.getCapitalized(skill.toString()), ENABLED + FOR_PVP);
  899. }
  900. public boolean getPVEEnabled(PrimarySkillType skill) {
  901. return getBooleanValue(SKILLS, StringUtils.getCapitalized(skill.toString()), ENABLED + FOR_PVE);
  902. }
  903. }