MainConfig.java 42 KB

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