2
0

MaterialMapStore.java 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361
  1. package com.gmail.nossr50.util;
  2. import org.bukkit.Material;
  3. import org.jetbrains.annotations.NotNull;
  4. import java.util.HashMap;
  5. import java.util.HashSet;
  6. import java.util.Locale;
  7. /**
  8. * Stores hash tables for item and block names
  9. * This allows for better support across multiple versions of Minecraft
  10. */
  11. public class MaterialMapStore {
  12. private final @NotNull HashSet<String> abilityBlackList;
  13. private final @NotNull HashSet<String> toolBlackList;
  14. private final @NotNull HashSet<String> mossyWhiteList;
  15. private final @NotNull HashSet<String> treeFellerDestructibleWhiteList;
  16. private final @NotNull HashSet<String> herbalismAbilityBlackList;
  17. private final @NotNull HashSet<String> blockCrackerWhiteList;
  18. private final @NotNull HashSet<String> canMakeShroomyWhiteList;
  19. private final @NotNull HashSet<String> multiBlockPlant;
  20. private final @NotNull HashSet<String> multiBlockHangingPlant;
  21. private final @NotNull HashSet<String> foodItemWhiteList;
  22. private final @NotNull HashSet<String> glassBlocks;
  23. private final @NotNull HashSet<String> netheriteArmor;
  24. private final @NotNull HashSet<String> netheriteTools;
  25. private final @NotNull HashSet<String> woodTools;
  26. private final @NotNull HashSet<String> stoneTools;
  27. private final @NotNull HashSet<String> leatherArmor;
  28. private final @NotNull HashSet<String> ironArmor;
  29. private final @NotNull HashSet<String> ironTools;
  30. private final @NotNull HashSet<String> stringTools;
  31. private final @NotNull HashSet<String> goldArmor;
  32. private final @NotNull HashSet<String> goldTools;
  33. private final @NotNull HashSet<String> chainmailArmor;
  34. private final @NotNull HashSet<String> diamondArmor;
  35. private final @NotNull HashSet<String> diamondTools;
  36. private final @NotNull HashSet<String> armors;
  37. private final @NotNull HashSet<String> swords;
  38. private final @NotNull HashSet<String> axes;
  39. private final @NotNull HashSet<String> hoes;
  40. private final @NotNull HashSet<String> shovels;
  41. private final @NotNull HashSet<String> pickAxes;
  42. private final @NotNull HashSet<String> tridents;
  43. private final @NotNull HashSet<String> bows;
  44. private final @NotNull HashSet<String> crossbows;
  45. private final @NotNull HashSet<String> tools;
  46. private final @NotNull HashSet<String> enchantables;
  47. private final @NotNull HashSet<String> ores;
  48. private final @NotNull HashSet<String> intendedToolPickAxe;
  49. private final @NotNull HashSet<String> intendedToolShovel;
  50. private final @NotNull HashMap<String, Integer> tierValue;
  51. public MaterialMapStore()
  52. {
  53. abilityBlackList = new HashSet<>();
  54. toolBlackList = new HashSet<>();
  55. mossyWhiteList = new HashSet<>();
  56. treeFellerDestructibleWhiteList = new HashSet<>();
  57. herbalismAbilityBlackList = new HashSet<>();
  58. blockCrackerWhiteList = new HashSet<>();
  59. canMakeShroomyWhiteList = new HashSet<>();
  60. multiBlockPlant = new HashSet<>();
  61. multiBlockHangingPlant = new HashSet<>();
  62. foodItemWhiteList = new HashSet<>();
  63. glassBlocks = new HashSet<>();
  64. leatherArmor = new HashSet<>();
  65. ironArmor = new HashSet<>();
  66. chainmailArmor = new HashSet<>();
  67. goldArmor = new HashSet<>();
  68. diamondArmor = new HashSet<>();
  69. netheriteArmor = new HashSet<>();
  70. armors = new HashSet<>();
  71. woodTools = new HashSet<>();
  72. stoneTools = new HashSet<>();
  73. ironTools = new HashSet<>();
  74. goldTools = new HashSet<>();
  75. diamondTools = new HashSet<>();
  76. netheriteTools = new HashSet<>();
  77. bows = new HashSet<>();
  78. crossbows = new HashSet<>();
  79. stringTools = new HashSet<>();
  80. tools = new HashSet<>();
  81. swords = new HashSet<>();
  82. axes = new HashSet<>();
  83. pickAxes = new HashSet<>();
  84. shovels = new HashSet<>();
  85. hoes = new HashSet<>();
  86. tridents = new HashSet<>();
  87. enchantables = new HashSet<>();
  88. ores = new HashSet<>();
  89. intendedToolPickAxe = new HashSet<>();
  90. intendedToolShovel = new HashSet<>();
  91. tierValue = new HashMap<>();
  92. fillVanillaMaterialRegisters();
  93. }
  94. private void fillVanillaMaterialRegisters() {
  95. //The order matters
  96. fillAbilityBlackList();
  97. fillToolBlackList();
  98. fillMossyWhiteList();
  99. fillTreeFellerDestructibleWhiteList();
  100. fillHerbalismAbilityBlackList();
  101. fillBlockCrackerWhiteList();
  102. fillShroomyWhiteList();
  103. fillMultiBlockPlantSet();
  104. fillMultiBlockHangingPlantSet();
  105. fillFoodWhiteList();
  106. fillGlassBlockWhiteList();
  107. fillArmors();
  108. fillTools();
  109. fillEnchantables();
  110. fillOres();
  111. fillIntendedTools();
  112. fillTierMap();
  113. }
  114. public boolean isMultiBlockPlant(@NotNull Material material)
  115. {
  116. return multiBlockPlant.contains(material.getKey().getKey());
  117. }
  118. public boolean isMultiBlockHangingPlant(@NotNull Material material) {
  119. return multiBlockHangingPlant.contains(material.getKey().getKey());
  120. }
  121. public boolean isAbilityActivationBlackListed(@NotNull Material material)
  122. {
  123. return abilityBlackList.contains(material.getKey().getKey());
  124. }
  125. public boolean isToolActivationBlackListed(@NotNull Material material)
  126. {
  127. return toolBlackList.contains(material.getKey().getKey());
  128. }
  129. public boolean isMossyWhiteListed(@NotNull Material material)
  130. {
  131. return mossyWhiteList.contains(material.getKey().getKey());
  132. }
  133. public boolean isTreeFellerDestructible(@NotNull Material material)
  134. {
  135. return treeFellerDestructibleWhiteList.contains(material.getKey().getKey());
  136. }
  137. public boolean isHerbalismAbilityWhiteListed(@NotNull Material material)
  138. {
  139. return herbalismAbilityBlackList.contains(material.getKey().getKey());
  140. }
  141. public boolean isBlockCrackerWhiteListed(@NotNull Material material)
  142. {
  143. return blockCrackerWhiteList.contains(material.getKey().getKey());
  144. }
  145. public boolean isShroomyWhiteListed(@NotNull Material material)
  146. {
  147. return canMakeShroomyWhiteList.contains(material.getKey().getKey());
  148. }
  149. private void fillTierMap() {
  150. for(String id : leatherArmor) {
  151. tierValue.put(id, 1);
  152. }
  153. for(String id : ironArmor) {
  154. tierValue.put(id, 2);
  155. }
  156. for(String id : goldArmor) {
  157. tierValue.put(id, 3);
  158. }
  159. for(String id : chainmailArmor) {
  160. tierValue.put(id, 3);
  161. }
  162. for(String id : diamondArmor) {
  163. tierValue.put(id, 6);
  164. }
  165. for(String id : netheriteArmor) {
  166. tierValue.put(id, 12);
  167. }
  168. }
  169. private void fillOres() {
  170. ores.add("coal_ore");
  171. ores.add("diamond_ore");
  172. ores.add("nether_quartz_ore");
  173. ores.add("quartz_ore"); //Pre 1.13
  174. ores.add("gold_ore");
  175. ores.add("iron_ore");
  176. ores.add("lapis_ore");
  177. ores.add("lapis_lazuli_ore");
  178. ores.add("redstone_ore");
  179. ores.add("emerald_ore");
  180. ores.add("ancient_debris");
  181. ores.add("nether_gold_ore");
  182. ores.add("gilded_blackstone");
  183. //1.17 Mining Ore Blocks
  184. ores.add("deepslate_redstone_ore");
  185. ores.add("deepslate_copper_ore");
  186. ores.add("deepslate_coal_ore");
  187. ores.add("deepslate_diamond_ore");
  188. ores.add("deepslate_emerald_ore");
  189. ores.add("deepslate_iron_ore");
  190. ores.add("deepslate_gold_ore");
  191. // ores.add("deepslate_lapis_lazuli_ore");
  192. ores.add("deepslate_lapis_ore");
  193. ores.add("copper_ore");
  194. }
  195. private void fillIntendedTools() {
  196. intendedToolPickAxe.addAll(ores);
  197. intendedToolPickAxe.add("lapis_lazuli_ore");
  198. intendedToolPickAxe.add("packed_mud");
  199. intendedToolPickAxe.add("mud_bricks");
  200. intendedToolPickAxe.add("reinforced_deepslate");
  201. intendedToolPickAxe.add("ice");
  202. intendedToolPickAxe.add("packed_ice");
  203. intendedToolPickAxe.add("blue_ice");
  204. intendedToolPickAxe.add("frosted_ice");
  205. intendedToolPickAxe.add("anvil");
  206. intendedToolPickAxe.add("bell");
  207. intendedToolPickAxe.add("block_of_redstone");
  208. intendedToolPickAxe.add("brewing_stand");
  209. intendedToolPickAxe.add("cauldron");
  210. intendedToolPickAxe.add("chain");
  211. intendedToolPickAxe.add("hopper");
  212. intendedToolPickAxe.add("iron_bars");
  213. intendedToolPickAxe.add("iron_door");
  214. intendedToolPickAxe.add("iron_trapdoor");
  215. intendedToolPickAxe.add("lantern");
  216. intendedToolPickAxe.add("weighted_pressure_plates");
  217. intendedToolPickAxe.add("block_of_iron");
  218. intendedToolPickAxe.add("copper_blocks");
  219. intendedToolPickAxe.add("cut_copper");
  220. intendedToolPickAxe.add("cut_copper_slab");
  221. intendedToolPickAxe.add("cut_copper_stairs");
  222. intendedToolPickAxe.add("lapis_lazuli_block");
  223. intendedToolPickAxe.add("lightning_rod");
  224. intendedToolPickAxe.add("block_of_diamond");
  225. intendedToolPickAxe.add("block_of_emerald");
  226. intendedToolPickAxe.add("block_of_gold");
  227. intendedToolPickAxe.add("block_of_netherite");
  228. intendedToolPickAxe.add("piston");
  229. intendedToolPickAxe.add("sticky_piston");
  230. intendedToolPickAxe.add("conduit");
  231. intendedToolPickAxe.add("shulker_box");
  232. intendedToolPickAxe.add("element_constructor"); //be & ee
  233. intendedToolPickAxe.add("compound_creator"); //be & ee
  234. intendedToolPickAxe.add("material_reducer"); //be & ee
  235. intendedToolPickAxe.add("activator_rail");
  236. intendedToolPickAxe.add("detector_rail");
  237. intendedToolPickAxe.add("powered_rail");
  238. intendedToolPickAxe.add("rail");
  239. intendedToolPickAxe.add("andesite");
  240. intendedToolPickAxe.add("basalt");
  241. intendedToolPickAxe.add("blackstone");
  242. intendedToolPickAxe.add("blast_furnace");
  243. intendedToolPickAxe.add("block_of_coal");
  244. intendedToolPickAxe.add("block_of_quartz");
  245. intendedToolPickAxe.add("bricks");
  246. intendedToolPickAxe.add("cobblestone");
  247. intendedToolPickAxe.add("cobblestone_wall");
  248. intendedToolPickAxe.add("concrete");
  249. intendedToolPickAxe.add("dark_prismarine");
  250. intendedToolPickAxe.add("diorite");
  251. intendedToolPickAxe.add("dispenser");
  252. intendedToolPickAxe.add("dripstone_block");
  253. intendedToolPickAxe.add("dropper");
  254. intendedToolPickAxe.add("enchantment_table");
  255. intendedToolPickAxe.add("end_stone");
  256. intendedToolPickAxe.add("ender_chest");
  257. intendedToolPickAxe.add("furnace");
  258. intendedToolPickAxe.add("glazed_terracotta");
  259. intendedToolPickAxe.add("granite");
  260. intendedToolPickAxe.add("grindstone");
  261. intendedToolPickAxe.add("heat_block"); //be & ee
  262. intendedToolPickAxe.add("lodestone");
  263. intendedToolPickAxe.add("mossy_cobblestone");
  264. intendedToolPickAxe.add("nether_bricks");
  265. intendedToolPickAxe.add("nether_brick_fence");
  266. intendedToolPickAxe.add("nether_gold_ore");
  267. intendedToolPickAxe.add("nether_quartz_ore");
  268. intendedToolPickAxe.add("netherrack");
  269. intendedToolPickAxe.add("observer");
  270. intendedToolPickAxe.add("prismarine");
  271. intendedToolPickAxe.add("prismarine_bricks");
  272. intendedToolPickAxe.add("pointed_dripstone");
  273. intendedToolPickAxe.add("polished_andesite");
  274. intendedToolPickAxe.add("polished_blackstone");
  275. intendedToolPickAxe.add("polished_blackstone_bricks");
  276. intendedToolPickAxe.add("polished_diorite");
  277. intendedToolPickAxe.add("polished_granite");
  278. intendedToolPickAxe.add("red_sandstone");
  279. intendedToolPickAxe.add("sandstone");
  280. intendedToolPickAxe.add("smoker");
  281. intendedToolPickAxe.add("spawner");
  282. intendedToolPickAxe.add("stonecutter");
  283. // intendedToolPickAxe.add("slabs");
  284. intendedToolPickAxe.add("colored_terracotta");
  285. // intendedToolPickAxe.add("stairs");
  286. intendedToolPickAxe.add("smooth_stone");
  287. intendedToolPickAxe.add("stone");
  288. intendedToolPickAxe.add("stone_bricks");
  289. intendedToolPickAxe.add("stone_button");
  290. intendedToolPickAxe.add("stone_pressure_plate");
  291. intendedToolPickAxe.add("terracotta");
  292. intendedToolPickAxe.add("ancient_debris");
  293. intendedToolPickAxe.add("crying_obsidian");
  294. intendedToolPickAxe.add("glowing_obsidian"); //be
  295. intendedToolPickAxe.add("obsidian");
  296. intendedToolPickAxe.add("respawn_anchor");
  297. //slabs
  298. intendedToolPickAxe.add("petrified_oak_slab");
  299. intendedToolPickAxe.add("stone_slab");
  300. intendedToolPickAxe.add("smooth_stone_slab");
  301. intendedToolPickAxe.add("cobblestone_slab");
  302. intendedToolPickAxe.add("mossy_cobblestone_slab");
  303. intendedToolPickAxe.add("stone_brick_slab");
  304. intendedToolPickAxe.add("mossy_stone_brick_slab");
  305. intendedToolPickAxe.add("andesite_slab");
  306. intendedToolPickAxe.add("polished_andesite_slab");
  307. intendedToolPickAxe.add("diorite_slab");
  308. intendedToolPickAxe.add("polished_diorite_slab");
  309. intendedToolPickAxe.add("granite_slab");
  310. intendedToolPickAxe.add("polished_granite_slab");
  311. intendedToolPickAxe.add("sandstone_slab");
  312. intendedToolPickAxe.add("cut_sandstone_slab");
  313. intendedToolPickAxe.add("smooth_sandstone_slab");
  314. intendedToolPickAxe.add("red_sandstone_slab");
  315. intendedToolPickAxe.add("cut_red_sandstone_slab");
  316. intendedToolPickAxe.add("smooth_red_sandstone_slab");
  317. intendedToolPickAxe.add("brick_slab");
  318. intendedToolPickAxe.add("prismarine_brick_slab");
  319. intendedToolPickAxe.add("dark_prismarine_slab");
  320. intendedToolPickAxe.add("nether_brick_slab");
  321. intendedToolPickAxe.add("red_netherbrick_slab");
  322. intendedToolPickAxe.add("quartz_slab");
  323. intendedToolPickAxe.add("smooth_quartz_slab");
  324. intendedToolPickAxe.add("purpur_slab");
  325. intendedToolPickAxe.add("end_stone_brick_slab");
  326. intendedToolPickAxe.add("blackstone_slab");
  327. intendedToolPickAxe.add("polished_blackstone_slab");
  328. intendedToolPickAxe.add("polished_blackstone_brick_slab");
  329. intendedToolPickAxe.add("lightly_weathered_cut_copper_slab");
  330. intendedToolPickAxe.add("semi_weathered_cut_copper_slab");
  331. intendedToolPickAxe.add("waxed_semi_weathered_cut_copper_slab");
  332. intendedToolPickAxe.add("weathered_cut_copper_slab");
  333. intendedToolPickAxe.add("waxed_cut_copper_slab");
  334. intendedToolPickAxe.add("waxed_lightly_weathered_cut_copper_slab");
  335. //stairs (not all of these exist, just copied the above list and replaced slab with stairs)
  336. intendedToolPickAxe.add("petrified_oak_stairs");
  337. intendedToolPickAxe.add("stone_stairs");
  338. intendedToolPickAxe.add("smooth_stone_stairs");
  339. intendedToolPickAxe.add("cobblestone_stairs");
  340. intendedToolPickAxe.add("mossy_cobblestone_stairs");
  341. intendedToolPickAxe.add("stone_brick_stairs");
  342. intendedToolPickAxe.add("mossy_stone_brick_stairs");
  343. intendedToolPickAxe.add("andesite_stairs");
  344. intendedToolPickAxe.add("polished_andesite_stairs");
  345. intendedToolPickAxe.add("diorite_stairs");
  346. intendedToolPickAxe.add("polished_diorite_stairs");
  347. intendedToolPickAxe.add("granite_stairs");
  348. intendedToolPickAxe.add("polished_granite_stairs");
  349. intendedToolPickAxe.add("sandstone_stairs");
  350. intendedToolPickAxe.add("cut_sandstone_stairs");
  351. intendedToolPickAxe.add("smooth_sandstone_stairs");
  352. intendedToolPickAxe.add("red_sandstone_stairs");
  353. intendedToolPickAxe.add("cut_red_sandstone_stairs");
  354. intendedToolPickAxe.add("smooth_red_sandstone_stairs");
  355. intendedToolPickAxe.add("brick_stairs");
  356. intendedToolPickAxe.add("prismarine_brick_stairs");
  357. intendedToolPickAxe.add("dark_prismarine_stairs");
  358. intendedToolPickAxe.add("nether_brick_stairs");
  359. intendedToolPickAxe.add("red_netherbrick_stairs");
  360. intendedToolPickAxe.add("quartz_stairs");
  361. intendedToolPickAxe.add("smooth_quartz_stairs");
  362. intendedToolPickAxe.add("purpur_stairs");
  363. intendedToolPickAxe.add("end_stone_brick_stairs");
  364. intendedToolPickAxe.add("blackstone_stairs");
  365. intendedToolPickAxe.add("polished_blackstone_stairs");
  366. intendedToolPickAxe.add("polished_blackstone_brick_stairs");
  367. intendedToolPickAxe.add("lightly_weathered_cut_copper_stairs");
  368. intendedToolPickAxe.add("semi_weathered_cut_copper_stairs");
  369. intendedToolPickAxe.add("waxed_semi_weathered_cut_copper_stairs");
  370. intendedToolPickAxe.add("weathered_cut_copper_stairs");
  371. intendedToolPickAxe.add("waxed_cut_copper_stairs");
  372. intendedToolPickAxe.add("waxed_lightly_weathered_cut_copper_stairs");
  373. //1.17 Mining (non-ores)
  374. intendedToolPickAxe.add("calcite");
  375. intendedToolPickAxe.add("smooth_basalt");
  376. intendedToolPickAxe.add("block_of_amethyst");
  377. intendedToolPickAxe.add("small_amethyst_bud");
  378. intendedToolPickAxe.add("medium_amethyst_bud");
  379. intendedToolPickAxe.add("large_amethyst_bud");
  380. intendedToolPickAxe.add("amethyst_cluster");
  381. intendedToolPickAxe.add("budding_amethyst");
  382. intendedToolPickAxe.add("deepslate");
  383. intendedToolPickAxe.add("cobbled_deepslate");
  384. intendedToolPickAxe.add("tuff");
  385. }
  386. private void fillArmors() {
  387. fillLeatherArmorWhiteList();
  388. fillIronArmorWhiteList();
  389. fillChainmailWhiteList();
  390. fillGoldArmorWhiteList();
  391. fillDiamondArmorWhiteList();
  392. fillnetheriteArmorWhiteList();
  393. //Add all armors to armors hashset
  394. armors.addAll(leatherArmor);
  395. armors.addAll(ironArmor);
  396. armors.addAll(chainmailArmor);
  397. armors.addAll(goldArmor);
  398. armors.addAll(diamondArmor);
  399. armors.addAll(netheriteArmor);
  400. armors.add("turtle_shell");
  401. }
  402. private void fillEnchantables() {
  403. enchantables.addAll(armors);
  404. enchantables.addAll(swords);
  405. enchantables.addAll(axes);
  406. enchantables.addAll(hoes);
  407. enchantables.addAll(pickAxes);
  408. enchantables.addAll(tridents);
  409. enchantables.addAll(bows);
  410. enchantables.addAll(crossbows);
  411. enchantables.add("shears");
  412. enchantables.add("fishing_rod");
  413. enchantables.add("carrot_on_a_stick");
  414. enchantables.add("enchanted_book");
  415. enchantables.add("flint_and_steel");
  416. enchantables.add("turtle_shell");
  417. }
  418. private void fillTools() {
  419. fillWoodToolsWhiteList();
  420. fillStoneToolsWhiteList();
  421. fillIronToolsWhiteList();
  422. fillGoldToolsWhiteList();
  423. fillDiamondToolsWhiteList();
  424. fillnetheriteToolsWhiteList();
  425. fillSwords();
  426. fillAxes();
  427. fillPickAxes();
  428. fillHoes();
  429. fillShovels();
  430. fillTridents();
  431. fillStringTools();
  432. fillBows();
  433. fillCrossbows();
  434. //Tools collection
  435. tools.addAll(woodTools);
  436. tools.addAll(stoneTools);
  437. tools.addAll(ironTools);
  438. tools.addAll(goldTools);
  439. tools.addAll(diamondTools);
  440. tools.addAll(netheriteTools);
  441. tools.addAll(tridents);
  442. tools.addAll(stringTools);
  443. tools.addAll(bows);
  444. tools.addAll(crossbows);
  445. }
  446. private void fillBows() {
  447. bows.add("bow");
  448. }
  449. private void fillCrossbows() {
  450. crossbows.add("crossbow");
  451. }
  452. private void fillStringTools() {
  453. stringTools.add("bow");
  454. stringTools.add("fishing_rod");
  455. stringTools.add("carrot_on_a_stick");
  456. }
  457. private void fillTridents() {
  458. tridents.add("trident");
  459. }
  460. private void fillSwords() {
  461. swords.add("wood_sword");
  462. swords.add("wooden_sword");
  463. swords.add("stone_sword");
  464. swords.add("iron_sword");
  465. swords.add("gold_sword");
  466. swords.add("golden_sword");
  467. swords.add("diamond_sword");
  468. swords.add("netherite_sword");
  469. }
  470. private void fillAxes() {
  471. axes.add("wood_axe");
  472. axes.add("wooden_axe");
  473. axes.add("stone_axe");
  474. axes.add("iron_axe");
  475. axes.add("gold_axe");
  476. axes.add("golden_axe");
  477. axes.add("diamond_axe");
  478. axes.add("netherite_axe");
  479. }
  480. private void fillPickAxes() {
  481. pickAxes.add("wood_pickaxe");
  482. pickAxes.add("wooden_pickaxe");
  483. pickAxes.add("stone_pickaxe");
  484. pickAxes.add("iron_pickaxe");
  485. pickAxes.add("gold_pickaxe");
  486. pickAxes.add("golden_pickaxe");
  487. pickAxes.add("diamond_pickaxe");
  488. pickAxes.add("netherite_pickaxe");
  489. }
  490. private void fillHoes() {
  491. hoes.add("wood_hoe");
  492. hoes.add("wooden_hoe");
  493. hoes.add("stone_hoe");
  494. hoes.add("iron_hoe");
  495. hoes.add("gold_hoe");
  496. hoes.add("golden_hoe");
  497. hoes.add("diamond_hoe");
  498. hoes.add("netherite_hoe");
  499. }
  500. private void fillShovels() {
  501. shovels.add("wood_shovel");
  502. shovels.add("wooden_shovel");
  503. shovels.add("stone_shovel");
  504. shovels.add("iron_shovel");
  505. shovels.add("gold_shovel");
  506. shovels.add("golden_shovel");
  507. shovels.add("diamond_shovel");
  508. shovels.add("netherite_shovel");
  509. }
  510. private void fillLeatherArmorWhiteList() {
  511. leatherArmor.add("leather_helmet");
  512. leatherArmor.add("leather_chestplate");
  513. leatherArmor.add("leather_leggings");
  514. leatherArmor.add("leather_boots");
  515. }
  516. private void fillIronArmorWhiteList() {
  517. ironArmor.add("iron_helmet");
  518. ironArmor.add("iron_chestplate");
  519. ironArmor.add("iron_leggings");
  520. ironArmor.add("iron_boots");
  521. }
  522. private void fillChainmailWhiteList() {
  523. chainmailArmor.add("chainmail_helmet");
  524. chainmailArmor.add("chainmail_chestplate");
  525. chainmailArmor.add("chainmail_leggings");
  526. chainmailArmor.add("chainmail_boots");
  527. }
  528. private void fillGoldArmorWhiteList() {
  529. goldArmor.add("gold_helmet");
  530. goldArmor.add("gold_chestplate");
  531. goldArmor.add("gold_leggings");
  532. goldArmor.add("gold_boots");
  533. //Gold became Golden post 1.13
  534. goldArmor.add("golden_helmet");
  535. goldArmor.add("golden_chestplate");
  536. goldArmor.add("golden_leggings");
  537. goldArmor.add("golden_boots");
  538. }
  539. private void fillDiamondArmorWhiteList() {
  540. diamondArmor.add("diamond_helmet");
  541. diamondArmor.add("diamond_chestplate");
  542. diamondArmor.add("diamond_leggings");
  543. diamondArmor.add("diamond_boots");
  544. }
  545. private void fillnetheriteArmorWhiteList() {
  546. netheriteArmor.add("netherite_helmet");
  547. netheriteArmor.add("netherite_chestplate");
  548. netheriteArmor.add("netherite_leggings");
  549. netheriteArmor.add("netherite_boots");
  550. }
  551. private void fillWoodToolsWhiteList() {
  552. woodTools.add("wood_sword");
  553. woodTools.add("wood_axe");
  554. woodTools.add("wood_hoe");
  555. woodTools.add("wood_pickaxe");
  556. woodTools.add("wood_shovel");
  557. //Wood became wooden post 1.13
  558. woodTools.add("wooden_sword");
  559. woodTools.add("wooden_axe");
  560. woodTools.add("wooden_hoe");
  561. woodTools.add("wooden_pickaxe");
  562. woodTools.add("wooden_shovel");
  563. }
  564. private void fillStoneToolsWhiteList() {
  565. stoneTools.add("stone_sword");
  566. stoneTools.add("stone_axe");
  567. stoneTools.add("stone_hoe");
  568. stoneTools.add("stone_pickaxe");
  569. stoneTools.add("stone_shovel");
  570. }
  571. private void fillIronToolsWhiteList() {
  572. ironTools.add("iron_sword");
  573. ironTools.add("iron_axe");
  574. ironTools.add("iron_hoe");
  575. ironTools.add("iron_pickaxe");
  576. ironTools.add("iron_shovel");
  577. //Used for repair, remove in 2.2
  578. //TODO: Remove in config update
  579. ironTools.add("bucket");
  580. ironTools.add("flint_and_steel");
  581. ironTools.add("shears");
  582. }
  583. private void fillGoldToolsWhiteList() {
  584. goldTools.add("gold_sword");
  585. goldTools.add("gold_axe");
  586. goldTools.add("gold_hoe");
  587. goldTools.add("gold_pickaxe");
  588. goldTools.add("gold_shovel");
  589. //Gold became golden post 1.13
  590. goldTools.add("golden_sword");
  591. goldTools.add("golden_axe");
  592. goldTools.add("golden_hoe");
  593. goldTools.add("golden_pickaxe");
  594. goldTools.add("golden_shovel");
  595. }
  596. private void fillDiamondToolsWhiteList() {
  597. diamondTools.add("diamond_sword");
  598. diamondTools.add("diamond_axe");
  599. diamondTools.add("diamond_hoe");
  600. diamondTools.add("diamond_pickaxe");
  601. diamondTools.add("diamond_shovel");
  602. }
  603. private void fillnetheriteToolsWhiteList() {
  604. netheriteTools.add("netherite_sword");
  605. netheriteTools.add("netherite_axe");
  606. netheriteTools.add("netherite_hoe");
  607. netheriteTools.add("netherite_pickaxe");
  608. netheriteTools.add("netherite_shovel");
  609. }
  610. private void fillGlassBlockWhiteList() {
  611. glassBlocks.add("glass");
  612. glassBlocks.add("glass_pane");
  613. glassBlocks.add("black_stained_glass");
  614. glassBlocks.add("black_stained_glass_pane");
  615. glassBlocks.add("blue_stained_glass");
  616. glassBlocks.add("blue_stained_glass_pane");
  617. glassBlocks.add("brown_stained_glass");
  618. glassBlocks.add("brown_stained_glass_pane");
  619. glassBlocks.add("cyan_stained_glass");
  620. glassBlocks.add("cyan_stained_glass_pane");
  621. glassBlocks.add("gray_stained_glass");
  622. glassBlocks.add("gray_stained_glass_pane");
  623. glassBlocks.add("green_stained_glass");
  624. glassBlocks.add("green_stained_glass_pane");
  625. glassBlocks.add("light_blue_stained_glass");
  626. glassBlocks.add("light_blue_stained_glass_pane");
  627. glassBlocks.add("light_gray_stained_glass");
  628. glassBlocks.add("light_gray_stained_glass_pane");
  629. glassBlocks.add("lime_stained_glass");
  630. glassBlocks.add("lime_stained_glass_pane");
  631. glassBlocks.add("magenta_stained_glass");
  632. glassBlocks.add("magenta_stained_glass_pane");
  633. glassBlocks.add("orange_stained_glass");
  634. glassBlocks.add("orange_stained_glass_pane");
  635. glassBlocks.add("pink_stained_glass");
  636. glassBlocks.add("pink_stained_glass_pane");
  637. glassBlocks.add("purple_stained_glass");
  638. glassBlocks.add("purple_stained_glass_pane");
  639. glassBlocks.add("red_stained_glass");
  640. glassBlocks.add("red_stained_glass_pane");
  641. glassBlocks.add("white_stained_glass");
  642. glassBlocks.add("white_stained_glass_pane");
  643. glassBlocks.add("yellow_stained_glass");
  644. glassBlocks.add("yellow_stained_glass_pane");
  645. }
  646. private void fillFoodWhiteList() {
  647. foodItemWhiteList.add("apple");
  648. foodItemWhiteList.add("baked_potato");
  649. foodItemWhiteList.add("beetroot");
  650. foodItemWhiteList.add("beetroot_soup");
  651. foodItemWhiteList.add("bread");
  652. foodItemWhiteList.add("cake");
  653. foodItemWhiteList.add("carrot");
  654. foodItemWhiteList.add("chorus_fruit");
  655. foodItemWhiteList.add("cooked_chicken");
  656. foodItemWhiteList.add("cooked_cod");
  657. foodItemWhiteList.add("cooked_mutton");
  658. foodItemWhiteList.add("cooked_porkchop");
  659. foodItemWhiteList.add("cooked_rabbit");
  660. foodItemWhiteList.add("cooked_salmon");
  661. foodItemWhiteList.add("cookie");
  662. foodItemWhiteList.add("dried_kelp");
  663. foodItemWhiteList.add("golden_apple");
  664. foodItemWhiteList.add("enchanted_golden_apple");
  665. foodItemWhiteList.add("golden_carrot");
  666. foodItemWhiteList.add("melon_slice");
  667. foodItemWhiteList.add("mushroom_stew");
  668. foodItemWhiteList.add("poisonous_potato");
  669. foodItemWhiteList.add("potato");
  670. foodItemWhiteList.add("pumpkin_pie");
  671. foodItemWhiteList.add("rabbit_stew");
  672. foodItemWhiteList.add("raw_beef");
  673. foodItemWhiteList.add("raw_chicken");
  674. foodItemWhiteList.add("raw_cod");
  675. foodItemWhiteList.add("raw_mutton");
  676. foodItemWhiteList.add("raw_porkchop");
  677. foodItemWhiteList.add("raw_rabbit");
  678. foodItemWhiteList.add("raw_salmon");
  679. foodItemWhiteList.add("rotten_flesh");
  680. foodItemWhiteList.add("suspicious_stew");
  681. foodItemWhiteList.add("sweet_berries");
  682. foodItemWhiteList.add("tropical_fish");
  683. }
  684. /**
  685. * Checks if a Material is used for Armor
  686. * @param material target material
  687. * @return true if it is used for armor
  688. */
  689. public boolean isArmor(@NotNull Material material) {
  690. return isArmor(material.getKey().getKey());
  691. }
  692. /**
  693. * Checks if the id provided is used as armor
  694. * @param id target item id
  695. * @return true if the item id matches armor
  696. */
  697. public boolean isArmor(@NotNull String id) {
  698. return armors.contains(id);
  699. }
  700. public boolean isTool(@NotNull Material material) {
  701. return isTool(material.getKey().getKey());
  702. }
  703. public boolean isTool(@NotNull String id) {
  704. return tools.contains(id);
  705. }
  706. public boolean isEnchantable(@NotNull Material material) {
  707. return isEnchantable(material.getKey().getKey());
  708. }
  709. public boolean isEnchantable(@NotNull String id) {
  710. return enchantables.contains(id);
  711. }
  712. public boolean isOre(@NotNull Material material) {
  713. return isOre(material.getKey().getKey());
  714. }
  715. public boolean isOre(@NotNull String id) {
  716. return ores.contains(id);
  717. }
  718. public boolean isBow(@NotNull Material material) {
  719. return isBow(material.getKey().getKey());
  720. }
  721. public boolean isBow(@NotNull String id) {
  722. return bows.contains(id);
  723. }
  724. public boolean isCrossbow(@NotNull Material material) {
  725. return isCrossbow(material.getKey().getKey());
  726. }
  727. public boolean isCrossbow(@NotNull String id) {
  728. return crossbows.contains(id);
  729. }
  730. public boolean isTrident(@NotNull Material material) {
  731. return isTrident(material.getKey().getKey());
  732. }
  733. public boolean isTrident(@NotNull String id) {
  734. return tridents.contains(id);
  735. }
  736. public boolean isLeatherArmor(@NotNull Material material) {
  737. return isLeatherArmor(material.getKey().getKey());
  738. }
  739. public boolean isLeatherArmor(@NotNull String id) {
  740. return leatherArmor.contains(id);
  741. }
  742. public boolean isIronArmor(@NotNull Material material) {
  743. return isIronArmor(material.getKey().getKey());
  744. }
  745. public boolean isIronArmor(@NotNull String id) {
  746. return ironArmor.contains(id);
  747. }
  748. public boolean isGoldArmor(@NotNull Material material) {
  749. return isGoldArmor(material.getKey().getKey());
  750. }
  751. public boolean isGoldArmor(@NotNull String id) {
  752. return goldArmor.contains(id);
  753. }
  754. public boolean isDiamondArmor(@NotNull Material material) {
  755. return isDiamondArmor(material.getKey().getKey());
  756. }
  757. public boolean isDiamondArmor(@NotNull String id) {
  758. return diamondArmor.contains(id);
  759. }
  760. public boolean isChainmailArmor(@NotNull Material material) {
  761. return isChainmailArmor(material.getKey().getKey());
  762. }
  763. public boolean isChainmailArmor(@NotNull String id) {
  764. return chainmailArmor.contains(id);
  765. }
  766. public boolean isNetheriteArmor(@NotNull Material material) {
  767. return isNetheriteArmor(material.getKey().getKey());
  768. }
  769. public boolean isNetheriteArmor(@NotNull String id) {
  770. return netheriteArmor.contains(id);
  771. }
  772. public boolean isWoodTool(@NotNull Material material) {
  773. return isWoodTool(material.getKey().getKey());
  774. }
  775. public boolean isWoodTool(@NotNull String id) {
  776. return woodTools.contains(id);
  777. }
  778. public boolean isStoneTool(@NotNull Material material) {
  779. return isStoneTool(material.getKey().getKey());
  780. }
  781. public boolean isStoneTool(@NotNull String id) {
  782. return stoneTools.contains(id);
  783. }
  784. public boolean isIronTool(@NotNull Material material) {
  785. return isIronTool(material.getKey().getKey());
  786. }
  787. public boolean isIronTool(@NotNull String id) {
  788. return ironTools.contains(id);
  789. }
  790. public boolean isGoldTool(@NotNull Material material) {
  791. return isGoldTool(material.getKey().getKey());
  792. }
  793. public boolean isGoldTool(@NotNull String id) {
  794. return goldTools.contains(id);
  795. }
  796. public boolean isDiamondTool(@NotNull Material material) {
  797. return isDiamondTool(material.getKey().getKey());
  798. }
  799. public boolean isDiamondTool(@NotNull String id) {
  800. return diamondTools.contains(id);
  801. }
  802. public boolean isSword(@NotNull Material material) {
  803. return isSword(material.getKey().getKey());
  804. }
  805. public boolean isSword(@NotNull String id) {
  806. return swords.contains(id);
  807. }
  808. public boolean isAxe(@NotNull Material material) {
  809. return isAxe(material.getKey().getKey());
  810. }
  811. public boolean isAxe(@NotNull String id) {
  812. return axes.contains(id);
  813. }
  814. public boolean isPickAxe(@NotNull Material material) {
  815. return isPickAxe(material.getKey().getKey());
  816. }
  817. public boolean isPickAxe(@NotNull String id) {
  818. return pickAxes.contains(id);
  819. }
  820. public boolean isShovel(@NotNull Material material) {
  821. return isShovel(material.getKey().getKey());
  822. }
  823. public boolean isShovel(@NotNull String id) {
  824. return shovels.contains(id);
  825. }
  826. public boolean isHoe(@NotNull Material material) {
  827. return isHoe(material.getKey().getKey());
  828. }
  829. public boolean isHoe(@NotNull String id) {
  830. return hoes.contains(id);
  831. }
  832. public boolean isNetheriteTool(@NotNull Material material) {
  833. return isNetheriteTool(material.getKey().getKey());
  834. }
  835. public boolean isNetheriteTool(@NotNull String id) {
  836. return netheriteTools.contains(id);
  837. }
  838. public boolean isStringTool(@NotNull Material material) {
  839. return isStringTool(material.getKey().getKey());
  840. }
  841. public boolean isStringTool(@NotNull String id) {
  842. return stringTools.contains(id);
  843. }
  844. public boolean isGlass(@NotNull Material material) {
  845. return glassBlocks.contains(material.getKey().getKey());
  846. }
  847. public boolean isFood(@NotNull Material material) {
  848. return foodItemWhiteList.contains(material.getKey().getKey());
  849. }
  850. private void fillMultiBlockPlantSet()
  851. {
  852. //Multi-Block Plants
  853. multiBlockPlant.add("cactus");
  854. multiBlockPlant.add("chorus_plant");
  855. multiBlockPlant.add("chorus_flower");
  856. multiBlockPlant.add("sugar_cane");
  857. multiBlockPlant.add("kelp_plant");
  858. multiBlockPlant.add("kelp");
  859. multiBlockPlant.add("tall_seagrass");
  860. multiBlockPlant.add("large_fern");
  861. multiBlockPlant.add("tall_grass");
  862. multiBlockPlant.add("bamboo");
  863. }
  864. private void fillMultiBlockHangingPlantSet() {
  865. multiBlockHangingPlant.add("weeping_vines_plant");
  866. multiBlockHangingPlant.add("twisted_vines_plant");
  867. multiBlockHangingPlant.add("cave_vines_plant");
  868. }
  869. private void fillShroomyWhiteList()
  870. {
  871. canMakeShroomyWhiteList.add("dirt");
  872. canMakeShroomyWhiteList.add("grass_block");
  873. canMakeShroomyWhiteList.add("dirt_path");
  874. }
  875. private void fillBlockCrackerWhiteList()
  876. {
  877. blockCrackerWhiteList.add("stone_bricks");
  878. blockCrackerWhiteList.add("infested_stone_bricks");
  879. }
  880. private void fillHerbalismAbilityBlackList()
  881. {
  882. herbalismAbilityBlackList.add("dirt");
  883. herbalismAbilityBlackList.add("grass_block");
  884. herbalismAbilityBlackList.add("dirt_path");
  885. herbalismAbilityBlackList.add("farmland");
  886. }
  887. private void fillTreeFellerDestructibleWhiteList()
  888. {
  889. treeFellerDestructibleWhiteList.add("oak_leaves");
  890. treeFellerDestructibleWhiteList.add("cherry_leaves");
  891. treeFellerDestructibleWhiteList.add("acacia_leaves");
  892. treeFellerDestructibleWhiteList.add("birch_leaves");
  893. treeFellerDestructibleWhiteList.add("dark_oak_leaves");
  894. treeFellerDestructibleWhiteList.add("jungle_leaves");
  895. treeFellerDestructibleWhiteList.add("spruce_leaves");
  896. treeFellerDestructibleWhiteList.add("azalea_leaves");
  897. treeFellerDestructibleWhiteList.add("flowering_azalea_leaves");
  898. treeFellerDestructibleWhiteList.add("mangrove_leaves");
  899. treeFellerDestructibleWhiteList.add("mangrove_roots");
  900. treeFellerDestructibleWhiteList.add("nether_wart_block");
  901. treeFellerDestructibleWhiteList.add("warped_wart_block");
  902. treeFellerDestructibleWhiteList.add("brown_mushroom_block");
  903. treeFellerDestructibleWhiteList.add("red_mushroom_block");
  904. }
  905. private void fillMossyWhiteList()
  906. {
  907. mossyWhiteList.add("cobblestone");
  908. mossyWhiteList.add("dirt");
  909. mossyWhiteList.add("grass_path");
  910. mossyWhiteList.add("stone_bricks");
  911. mossyWhiteList.add("cobblestone_wall");
  912. }
  913. private void fillAbilityBlackList()
  914. {
  915. abilityBlackList.add("warped_fence_gate");
  916. abilityBlackList.add("crimson_fence_gate");
  917. abilityBlackList.add("warped_pressure_plate");
  918. abilityBlackList.add("crimson_pressure_plate");
  919. abilityBlackList.add("warped_button");
  920. abilityBlackList.add("crimson_button");
  921. abilityBlackList.add("warped_door");
  922. abilityBlackList.add("crimson_door");
  923. abilityBlackList.add("warped_trapdoor");
  924. abilityBlackList.add("crimson_trapdoor");
  925. abilityBlackList.add("black_bed");
  926. abilityBlackList.add("blue_bed");
  927. abilityBlackList.add("brown_bed");
  928. abilityBlackList.add("cyan_bed");
  929. abilityBlackList.add("gray_bed");
  930. abilityBlackList.add("green_bed");
  931. abilityBlackList.add("light_blue_bed");
  932. abilityBlackList.add("light_gray_bed");
  933. abilityBlackList.add("lime_bed");
  934. abilityBlackList.add("magenta_bed");
  935. abilityBlackList.add("orange_bed");
  936. abilityBlackList.add("pink_bed");
  937. abilityBlackList.add("purple_bed");
  938. abilityBlackList.add("red_bed");
  939. abilityBlackList.add("white_bed");
  940. abilityBlackList.add("yellow_bed");
  941. abilityBlackList.add("brewing_stand");
  942. abilityBlackList.add("bookshelf");
  943. abilityBlackList.add("cake");
  944. abilityBlackList.add("chest");
  945. abilityBlackList.add("dispenser");
  946. abilityBlackList.add("enchanting_table");
  947. abilityBlackList.add("ender_chest");
  948. abilityBlackList.add("oak_fence_gate");
  949. abilityBlackList.add("acacia_fence_gate");
  950. abilityBlackList.add("dark_oak_fence_gate");
  951. abilityBlackList.add("spruce_fence_gate");
  952. abilityBlackList.add("birch_fence_gate");
  953. abilityBlackList.add("jungle_fence_gate");
  954. abilityBlackList.add("furnace");
  955. abilityBlackList.add("jukebox");
  956. abilityBlackList.add("lever");
  957. abilityBlackList.add("note_block");
  958. abilityBlackList.add("stone_button");
  959. abilityBlackList.add("oak_button");
  960. abilityBlackList.add("birch_button");
  961. abilityBlackList.add("acacia_button");
  962. abilityBlackList.add("dark_oak_button");
  963. abilityBlackList.add("jungle_button");
  964. abilityBlackList.add("spruce_button");
  965. abilityBlackList.add("acacia_trapdoor");
  966. abilityBlackList.add("birch_trapdoor");
  967. abilityBlackList.add("dark_oak_trapdoor");
  968. abilityBlackList.add("jungle_trapdoor");
  969. abilityBlackList.add("oak_trapdoor");
  970. abilityBlackList.add("spruce_trapdoor");
  971. abilityBlackList.add("acacia_sign");
  972. abilityBlackList.add("acacia_wall_sign");
  973. abilityBlackList.add("birch_sign");
  974. abilityBlackList.add("birch_wall_sign");
  975. abilityBlackList.add("dark_oak_sign");
  976. abilityBlackList.add("dark_oak_wall_sign");
  977. abilityBlackList.add("jungle_sign");
  978. abilityBlackList.add("jungle_wall_sign");
  979. abilityBlackList.add("spruce_sign");
  980. abilityBlackList.add("spruce_wall_sign");
  981. abilityBlackList.add("oak_sign");
  982. abilityBlackList.add("oak_wall_sign");
  983. abilityBlackList.add("crafting_table");
  984. abilityBlackList.add("beacon");
  985. abilityBlackList.add("anvil");
  986. abilityBlackList.add("dropper");
  987. abilityBlackList.add("hopper");
  988. abilityBlackList.add("trapped_chest");
  989. abilityBlackList.add("iron_door");
  990. abilityBlackList.add("iron_trapdoor");
  991. abilityBlackList.add("oak_door");
  992. abilityBlackList.add("acacia_door");
  993. abilityBlackList.add("spruce_door");
  994. abilityBlackList.add("birch_door");
  995. abilityBlackList.add("jungle_door");
  996. abilityBlackList.add("dark_oak_door");
  997. abilityBlackList.add("oak_fence");
  998. abilityBlackList.add("acacia_fence");
  999. abilityBlackList.add("dark_oak_fence");
  1000. abilityBlackList.add("birch_fence");
  1001. abilityBlackList.add("jungle_fence");
  1002. abilityBlackList.add("spruce_fence");
  1003. abilityBlackList.add("armor_stand");
  1004. abilityBlackList.add("black_shulker_box");
  1005. abilityBlackList.add("blue_shulker_box");
  1006. abilityBlackList.add("brown_shulker_box");
  1007. abilityBlackList.add("cyan_shulker_box");
  1008. abilityBlackList.add("gray_shulker_box");
  1009. abilityBlackList.add("green_shulker_box");
  1010. abilityBlackList.add("light_blue_shulker_box");
  1011. abilityBlackList.add("lime_shulker_box");
  1012. abilityBlackList.add("magenta_shulker_box");
  1013. abilityBlackList.add("orange_shulker_box");
  1014. abilityBlackList.add("pink_shulker_box");
  1015. abilityBlackList.add("purple_shulker_box");
  1016. abilityBlackList.add("red_shulker_box");
  1017. abilityBlackList.add("light_gray_shulker_box");
  1018. abilityBlackList.add("white_shulker_box");
  1019. abilityBlackList.add("yellow_shulker_box");
  1020. abilityBlackList.add("shulker_box");
  1021. abilityBlackList.add("wall_sign"); //1.13 and lower?
  1022. abilityBlackList.add("sign"); //1.13 and lower?
  1023. abilityBlackList.add("cartography_table");
  1024. abilityBlackList.add("grindstone");
  1025. abilityBlackList.add("lectern");
  1026. abilityBlackList.add("loom");
  1027. abilityBlackList.add("scaffolding");
  1028. abilityBlackList.add("smoker");
  1029. abilityBlackList.add("stonecutter");
  1030. abilityBlackList.add("sweet_berry_bush");
  1031. abilityBlackList.add("bell");
  1032. abilityBlackList.add("barrel");
  1033. abilityBlackList.add("blast_furnace");
  1034. abilityBlackList.add("campfire");
  1035. abilityBlackList.add("soul_campfire");
  1036. abilityBlackList.add("composter");
  1037. abilityBlackList.add("lodestone");
  1038. abilityBlackList.add("respawn_anchor");
  1039. }
  1040. private void fillToolBlackList()
  1041. {
  1042. toolBlackList.add("chiseled_bookshelf");
  1043. toolBlackList.add("black_bed");
  1044. toolBlackList.add("blue_bed");
  1045. toolBlackList.add("brown_bed");
  1046. toolBlackList.add("cyan_bed");
  1047. toolBlackList.add("gray_bed");
  1048. toolBlackList.add("green_bed");
  1049. toolBlackList.add("light_blue_bed");
  1050. toolBlackList.add("light_gray_bed");
  1051. toolBlackList.add("lime_bed");
  1052. toolBlackList.add("magenta_bed");
  1053. toolBlackList.add("orange_bed");
  1054. toolBlackList.add("pink_bed");
  1055. toolBlackList.add("purple_bed");
  1056. toolBlackList.add("red_bed");
  1057. toolBlackList.add("white_bed");
  1058. toolBlackList.add("yellow_bed");
  1059. toolBlackList.add("brewing_stand");
  1060. toolBlackList.add("bookshelf");
  1061. toolBlackList.add("cake");
  1062. toolBlackList.add("chest");
  1063. toolBlackList.add("dispenser");
  1064. toolBlackList.add("enchanting_table");
  1065. toolBlackList.add("ender_chest");
  1066. toolBlackList.add("oak_fence_gate");
  1067. toolBlackList.add("acacia_fence_gate");
  1068. toolBlackList.add("dark_oak_fence_gate");
  1069. toolBlackList.add("spruce_fence_gate");
  1070. toolBlackList.add("birch_fence_gate");
  1071. toolBlackList.add("jungle_fence_gate");
  1072. toolBlackList.add("furnace");
  1073. toolBlackList.add("jukebox");
  1074. toolBlackList.add("lever");
  1075. toolBlackList.add("note_block");
  1076. toolBlackList.add("stone_button");
  1077. toolBlackList.add("oak_button");
  1078. toolBlackList.add("birch_button");
  1079. toolBlackList.add("acacia_button");
  1080. toolBlackList.add("dark_oak_button");
  1081. toolBlackList.add("jungle_button");
  1082. toolBlackList.add("spruce_button");
  1083. toolBlackList.add("acacia_trapdoor");
  1084. toolBlackList.add("birch_trapdoor");
  1085. toolBlackList.add("dark_oak_trapdoor");
  1086. toolBlackList.add("jungle_trapdoor");
  1087. toolBlackList.add("oak_trapdoor");
  1088. toolBlackList.add("spruce_trapdoor");
  1089. toolBlackList.add("crafting_table");
  1090. toolBlackList.add("beacon");
  1091. toolBlackList.add("anvil");
  1092. toolBlackList.add("dropper");
  1093. toolBlackList.add("hopper");
  1094. toolBlackList.add("trapped_chest");
  1095. toolBlackList.add("iron_door");
  1096. toolBlackList.add("iron_trapdoor");
  1097. toolBlackList.add("oak_door");
  1098. toolBlackList.add("acacia_door");
  1099. toolBlackList.add("spruce_door");
  1100. toolBlackList.add("birch_door");
  1101. toolBlackList.add("jungle_door");
  1102. toolBlackList.add("dark_oak_door");
  1103. toolBlackList.add("oak_fence");
  1104. toolBlackList.add("acacia_fence");
  1105. toolBlackList.add("dark_oak_fence");
  1106. toolBlackList.add("birch_fence");
  1107. toolBlackList.add("jungle_fence");
  1108. toolBlackList.add("spruce_fence");
  1109. toolBlackList.add("armor_stand");
  1110. toolBlackList.add("black_shulker_box");
  1111. toolBlackList.add("blue_shulker_box");
  1112. toolBlackList.add("brown_shulker_box");
  1113. toolBlackList.add("cyan_shulker_box");
  1114. toolBlackList.add("gray_shulker_box");
  1115. toolBlackList.add("green_shulker_box");
  1116. toolBlackList.add("light_blue_shulker_box");
  1117. toolBlackList.add("lime_shulker_box");
  1118. toolBlackList.add("magenta_shulker_box");
  1119. toolBlackList.add("orange_shulker_box");
  1120. toolBlackList.add("pink_shulker_box");
  1121. toolBlackList.add("purple_shulker_box");
  1122. toolBlackList.add("red_shulker_box");
  1123. toolBlackList.add("light_gray_shulker_box");
  1124. toolBlackList.add("white_shulker_box");
  1125. toolBlackList.add("yellow_shulker_box");
  1126. toolBlackList.add("shulker_box");
  1127. toolBlackList.add("acacia_sign");
  1128. toolBlackList.add("acacia_hanging_sign");
  1129. toolBlackList.add("acacia_wall_sign");
  1130. toolBlackList.add("birch_sign");
  1131. toolBlackList.add("birch_hanging_sign");
  1132. toolBlackList.add("birch_wall_sign");
  1133. toolBlackList.add("dark_oak_sign");
  1134. toolBlackList.add("dark_oak_hanging_sign");
  1135. toolBlackList.add("dark_oak_wall_sign");
  1136. toolBlackList.add("jungle_sign");
  1137. toolBlackList.add("jungle_hanging_sign");
  1138. toolBlackList.add("jungle_wall_sign");
  1139. toolBlackList.add("spruce_sign");
  1140. toolBlackList.add("spruce_hanging_sign");
  1141. toolBlackList.add("spruce_wall_sign");
  1142. toolBlackList.add("oak_sign");
  1143. toolBlackList.add("oak_hanging_sign");
  1144. toolBlackList.add("oak_wall_sign");
  1145. toolBlackList.add("cherry_sign");
  1146. toolBlackList.add("cherry_hanging_sign");
  1147. toolBlackList.add("cherry_wall_sign");
  1148. toolBlackList.add("stripped_cherry_log");
  1149. toolBlackList.add("stripped_cherry_wood");
  1150. toolBlackList.add("stripped_acacia_log");
  1151. toolBlackList.add("stripped_acacia_wood");
  1152. toolBlackList.add("stripped_birch_log");
  1153. toolBlackList.add("stripped_birch_wood");
  1154. toolBlackList.add("stripped_dark_oak_log");
  1155. toolBlackList.add("stripped_dark_oak_wood");
  1156. toolBlackList.add("stripped_jungle_log");
  1157. toolBlackList.add("stripped_jungle_wood");
  1158. toolBlackList.add("stripped_oak_log");
  1159. toolBlackList.add("stripped_oak_wood");
  1160. toolBlackList.add("stripped_spruce_log");
  1161. toolBlackList.add("stripped_spruce_wood");
  1162. toolBlackList.add("mangrove_wood");
  1163. toolBlackList.add("mangrove_log");
  1164. toolBlackList.add("stripped_mangrove_log");
  1165. toolBlackList.add("acacia_log");
  1166. toolBlackList.add("acacia_wood");
  1167. toolBlackList.add("birch_log");
  1168. toolBlackList.add("birch_wood");
  1169. toolBlackList.add("dark_oak_log");
  1170. toolBlackList.add("dark_oak_wood");
  1171. toolBlackList.add("jungle_log");
  1172. toolBlackList.add("jungle_wood");
  1173. toolBlackList.add("oak_log");
  1174. toolBlackList.add("oak_wood");
  1175. toolBlackList.add("spruce_log");
  1176. toolBlackList.add("bell");
  1177. toolBlackList.add("barrel");
  1178. toolBlackList.add("blast_furnace");
  1179. toolBlackList.add("campfire");
  1180. toolBlackList.add("soul_campfire");
  1181. toolBlackList.add("cartography_table");
  1182. toolBlackList.add("composter");
  1183. toolBlackList.add("grindstone");
  1184. toolBlackList.add("lectern");
  1185. toolBlackList.add("loom");
  1186. toolBlackList.add("smoker");
  1187. toolBlackList.add("stonecutter");
  1188. toolBlackList.add("lodestone");
  1189. toolBlackList.add("respawn_anchor");
  1190. toolBlackList.add("sweet_berry_bush");
  1191. toolBlackList.add("smithing_table");
  1192. }
  1193. public boolean isIntendedToolPickaxe(@NotNull Material material) {
  1194. return intendedToolPickAxe.contains(material.getKey().getKey());
  1195. }
  1196. public boolean isIntendedToolPickaxe(@NotNull String string) {
  1197. return intendedToolPickAxe.contains(string);
  1198. }
  1199. public @NotNull HashSet<String> getNetheriteArmor() {
  1200. return netheriteArmor;
  1201. }
  1202. public @NotNull HashSet<String> getNetheriteTools() {
  1203. return netheriteTools;
  1204. }
  1205. public int getTier(@NotNull Material material) {
  1206. return getTier(material.getKey().getKey());
  1207. }
  1208. public int getTier(@NotNull String id) {
  1209. return tierValue.getOrDefault(id, 1); //1 for unknown items
  1210. }
  1211. private void addToHashSet(@NotNull String string, @NotNull HashSet<String> stringHashSet)
  1212. {
  1213. stringHashSet.add(string.toLowerCase(Locale.ENGLISH));
  1214. }
  1215. }