MainConfig.java 42 KB

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