|
@@ -2,6 +2,7 @@ package com.gmail.nossr50.core;
|
|
|
|
|
|
import org.bukkit.Material;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.Locale;
|
|
|
|
|
@@ -24,7 +25,39 @@ public class MaterialMapStore {
|
|
|
private HashSet<String> foodItemWhiteList;
|
|
|
private HashSet<String> glassBlocks;
|
|
|
|
|
|
- public MaterialMapStore() {
|
|
|
+ private HashSet<String> netheriteArmor;
|
|
|
+ private HashSet<String> netheriteTools;
|
|
|
+ private HashSet<String> woodTools;
|
|
|
+ private HashSet<String> stoneTools;
|
|
|
+ private HashSet<String> leatherArmor;
|
|
|
+ private HashSet<String> ironArmor;
|
|
|
+ private HashSet<String> ironTools;
|
|
|
+ private HashSet<String> stringTools;
|
|
|
+ private HashSet<String> goldArmor;
|
|
|
+ private HashSet<String> goldTools;
|
|
|
+ private HashSet<String> chainmailArmor;
|
|
|
+ private HashSet<String> diamondArmor;
|
|
|
+ private HashSet<String> diamondTools;
|
|
|
+ private HashSet<String> armors;
|
|
|
+
|
|
|
+ private HashSet<String> swords;
|
|
|
+ private HashSet<String> axes;
|
|
|
+ private HashSet<String> hoes;
|
|
|
+ private HashSet<String> shovels;
|
|
|
+ private HashSet<String> pickAxes;
|
|
|
+ private HashSet<String> tridents;
|
|
|
+ private HashSet<String> bows;
|
|
|
+ private HashSet<String> tools;
|
|
|
+
|
|
|
+ private HashSet<String> enchantables;
|
|
|
+
|
|
|
+ private HashSet<String> ores;
|
|
|
+
|
|
|
+ private HashMap<String, Integer> tierValue;
|
|
|
+
|
|
|
+
|
|
|
+ public MaterialMapStore()
|
|
|
+ {
|
|
|
abilityBlackList = new HashSet<>();
|
|
|
toolBlackList = new HashSet<>();
|
|
|
mossyWhiteList = new HashSet<>();
|
|
@@ -36,7 +69,38 @@ public class MaterialMapStore {
|
|
|
foodItemWhiteList = new HashSet<>();
|
|
|
glassBlocks = new HashSet<>();
|
|
|
|
|
|
- fillHardcodedHashSets();
|
|
|
+ leatherArmor = new HashSet<>();
|
|
|
+ ironArmor = new HashSet<>();
|
|
|
+ chainmailArmor = new HashSet<>();
|
|
|
+ goldArmor = new HashSet<>();
|
|
|
+ diamondArmor = new HashSet<>();
|
|
|
+ netheriteArmor = new HashSet<>();
|
|
|
+ armors = new HashSet<>();
|
|
|
+
|
|
|
+ woodTools = new HashSet<>();
|
|
|
+ stoneTools = new HashSet<>();
|
|
|
+ ironTools = new HashSet<>();
|
|
|
+ goldTools = new HashSet<>();
|
|
|
+ diamondTools = new HashSet<>();
|
|
|
+ netheriteTools = new HashSet<>();
|
|
|
+ bows = new HashSet<>();
|
|
|
+ stringTools = new HashSet<>();
|
|
|
+ tools = new HashSet<>();
|
|
|
+
|
|
|
+ swords = new HashSet<>();
|
|
|
+ axes = new HashSet<>();
|
|
|
+ pickAxes = new HashSet<>();
|
|
|
+ shovels = new HashSet<>();
|
|
|
+ hoes = new HashSet<>();
|
|
|
+ tridents = new HashSet<>();
|
|
|
+
|
|
|
+ enchantables = new HashSet<>();
|
|
|
+
|
|
|
+ ores = new HashSet<>();
|
|
|
+
|
|
|
+ tierValue = new HashMap<>();
|
|
|
+
|
|
|
+ fillVanillaMaterialRegisters();
|
|
|
}
|
|
|
|
|
|
public boolean isMultiBlockPlant(Material material)
|
|
@@ -72,7 +136,8 @@ public class MaterialMapStore {
|
|
|
return canMakeShroomyWhiteList.contains(material.getKey().getKey());
|
|
|
}
|
|
|
|
|
|
- private void fillHardcodedHashSets() {
|
|
|
+ private void fillVanillaMaterialRegisters()
|
|
|
+ {
|
|
|
fillAbilityBlackList();
|
|
|
fillToolBlackList();
|
|
|
fillMossyWhiteList();
|
|
@@ -83,6 +148,320 @@ public class MaterialMapStore {
|
|
|
fillMultiBlockEntitiesList();
|
|
|
fillFoodWhiteList();
|
|
|
fillGlassBlockWhiteList();
|
|
|
+ fillArmors();
|
|
|
+ fillTools();
|
|
|
+ fillEnchantables();
|
|
|
+ fillOres();
|
|
|
+
|
|
|
+ fillTierMap();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillTierMap() {
|
|
|
+ for(String id : leatherArmor) {
|
|
|
+ tierValue.put(id, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(String id : ironArmor) {
|
|
|
+ tierValue.put(id, 2);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(String id : goldArmor) {
|
|
|
+ tierValue.put(id, 3);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(String id : chainmailArmor) {
|
|
|
+ tierValue.put(id, 3);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(String id : diamondArmor) {
|
|
|
+ tierValue.put(id, 6);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(String id : netheriteArmor) {
|
|
|
+ tierValue.put(id, 12);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillOres() {
|
|
|
+ ores.add("coal_ore");
|
|
|
+ ores.add("diamond_ore");
|
|
|
+ ores.add("nether_quartz_ore");
|
|
|
+ ores.add("quartz_ore"); //Pre 1.13
|
|
|
+ ores.add("gold_ore");
|
|
|
+ ores.add("iron_ore");
|
|
|
+ ores.add("lapis_ore");
|
|
|
+ ores.add("redstone_ore");
|
|
|
+ ores.add("emerald_ore");
|
|
|
+ ores.add("ancient_debris");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillArmors() {
|
|
|
+ fillLeatherArmorWhiteList();
|
|
|
+ fillIronArmorWhiteList();
|
|
|
+ fillChainmailWhiteList();
|
|
|
+ fillGoldArmorWhiteList();
|
|
|
+ fillDiamondArmorWhiteList();
|
|
|
+ fillnetheriteArmorWhiteList();
|
|
|
+
|
|
|
+ //Add all armors to armors hashset
|
|
|
+ armors.addAll(leatherArmor);
|
|
|
+ armors.addAll(ironArmor);
|
|
|
+ armors.addAll(chainmailArmor);
|
|
|
+ armors.addAll(goldArmor);
|
|
|
+ armors.addAll(diamondArmor);
|
|
|
+ armors.addAll(netheriteArmor);
|
|
|
+
|
|
|
+ armors.add("turtle_shell");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillEnchantables() {
|
|
|
+ enchantables.addAll(armors);
|
|
|
+ enchantables.addAll(swords);
|
|
|
+ enchantables.addAll(axes);
|
|
|
+ enchantables.addAll(hoes);
|
|
|
+ enchantables.addAll(pickAxes);
|
|
|
+ enchantables.addAll(tridents);
|
|
|
+ enchantables.addAll(bows);
|
|
|
+
|
|
|
+ enchantables.add("shears");
|
|
|
+ enchantables.add("fishing_rod");
|
|
|
+ enchantables.add("carrot_on_a_stick");
|
|
|
+ enchantables.add("enchanted_book");
|
|
|
+ enchantables.add("flint_and_steel");
|
|
|
+ enchantables.add("turtle_shell");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillTools() {
|
|
|
+ fillWoodToolsWhiteList();
|
|
|
+ fillStoneToolsWhiteList();
|
|
|
+ fillIronToolsWhiteList();
|
|
|
+ fillGoldToolsWhiteList();
|
|
|
+ fillDiamondToolsWhiteList();
|
|
|
+ fillnetheriteToolsWhiteList();
|
|
|
+
|
|
|
+ fillSwords();
|
|
|
+ fillAxes();
|
|
|
+ fillPickAxes();
|
|
|
+ fillHoes();
|
|
|
+ fillShovels();
|
|
|
+ fillTridents();
|
|
|
+ fillStringTools();
|
|
|
+ fillBows();
|
|
|
+
|
|
|
+ //Tools collection
|
|
|
+ tools.addAll(woodTools);
|
|
|
+ tools.addAll(stoneTools);
|
|
|
+ tools.addAll(ironTools);
|
|
|
+ tools.addAll(goldTools);
|
|
|
+ tools.addAll(diamondTools);
|
|
|
+ tools.addAll(netheriteTools);
|
|
|
+ tools.addAll(tridents);
|
|
|
+ tools.addAll(stringTools);
|
|
|
+ tools.addAll(bows);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillBows() {
|
|
|
+ bows.add("bow");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillStringTools() {
|
|
|
+ stringTools.add("bow");
|
|
|
+ stringTools.add("fishing_rod");
|
|
|
+ stringTools.add("carrot_on_a_stick");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillTridents() {
|
|
|
+ tridents.add("trident");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillSwords() {
|
|
|
+ swords.add("wood_sword");
|
|
|
+ swords.add("wooden_sword");
|
|
|
+ swords.add("stone_sword");
|
|
|
+ swords.add("iron_sword");
|
|
|
+ swords.add("gold_sword");
|
|
|
+ swords.add("golden_sword");
|
|
|
+ swords.add("diamond_sword");
|
|
|
+ swords.add("netherite_sword");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillAxes() {
|
|
|
+ axes.add("wood_axe");
|
|
|
+ axes.add("wooden_axe");
|
|
|
+ axes.add("stone_axe");
|
|
|
+ axes.add("iron_axe");
|
|
|
+ axes.add("gold_axe");
|
|
|
+ axes.add("golden_axe");
|
|
|
+ axes.add("diamond_axe");
|
|
|
+ axes.add("netherite_axe");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillPickAxes() {
|
|
|
+ pickAxes.add("wood_pickaxe");
|
|
|
+ pickAxes.add("wooden_pickaxe");
|
|
|
+ pickAxes.add("stone_pickaxe");
|
|
|
+ pickAxes.add("iron_pickaxe");
|
|
|
+ pickAxes.add("gold_pickaxe");
|
|
|
+ pickAxes.add("golden_pickaxe");
|
|
|
+ pickAxes.add("diamond_pickaxe");
|
|
|
+ pickAxes.add("netherite_pickaxe");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillHoes() {
|
|
|
+ hoes.add("wood_hoe");
|
|
|
+ hoes.add("wooden_hoe");
|
|
|
+ hoes.add("stone_hoe");
|
|
|
+ hoes.add("iron_hoe");
|
|
|
+ hoes.add("gold_hoe");
|
|
|
+ hoes.add("golden_hoe");
|
|
|
+ hoes.add("diamond_hoe");
|
|
|
+ hoes.add("netherite_hoe");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillShovels() {
|
|
|
+ shovels.add("wood_shovel");
|
|
|
+ shovels.add("wooden_shovel");
|
|
|
+ shovels.add("stone_shovel");
|
|
|
+ shovels.add("iron_shovel");
|
|
|
+ shovels.add("gold_shovel");
|
|
|
+ shovels.add("golden_shovel");
|
|
|
+ shovels.add("diamond_shovel");
|
|
|
+ shovels.add("netherite_shovel");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillLeatherArmorWhiteList() {
|
|
|
+ leatherArmor.add("leather_helmet");
|
|
|
+ leatherArmor.add("leather_chestplate");
|
|
|
+ leatherArmor.add("leather_leggings");
|
|
|
+ leatherArmor.add("leather_boots");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillIronArmorWhiteList() {
|
|
|
+ ironArmor.add("iron_helmet");
|
|
|
+ ironArmor.add("iron_chestplate");
|
|
|
+ ironArmor.add("iron_leggings");
|
|
|
+ ironArmor.add("iron_boots");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillChainmailWhiteList() {
|
|
|
+ chainmailArmor.add("chainmail_helmet");
|
|
|
+ chainmailArmor.add("chainmail_chestplate");
|
|
|
+ chainmailArmor.add("chainmail_leggings");
|
|
|
+ chainmailArmor.add("chainmail_boots");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillGoldArmorWhiteList() {
|
|
|
+ goldArmor.add("gold_helmet");
|
|
|
+ goldArmor.add("gold_chestplate");
|
|
|
+ goldArmor.add("gold_leggings");
|
|
|
+ goldArmor.add("gold_boots");
|
|
|
+
|
|
|
+ //Gold became Golden post 1.13
|
|
|
+ goldArmor.add("golden_helmet");
|
|
|
+ goldArmor.add("golden_chestplate");
|
|
|
+ goldArmor.add("golden_leggings");
|
|
|
+ goldArmor.add("golden_boots");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillDiamondArmorWhiteList() {
|
|
|
+ diamondArmor.add("diamond_helmet");
|
|
|
+ diamondArmor.add("diamond_chestplate");
|
|
|
+ diamondArmor.add("diamond_leggings");
|
|
|
+ diamondArmor.add("diamond_boots");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillnetheriteArmorWhiteList() {
|
|
|
+ netheriteArmor.add("netherite_helmet");
|
|
|
+ netheriteArmor.add("netherite_chestplate");
|
|
|
+ netheriteArmor.add("netherite_leggings");
|
|
|
+ netheriteArmor.add("netherite_boots");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillWoodToolsWhiteList() {
|
|
|
+ woodTools.add("wood_sword");
|
|
|
+ woodTools.add("wood_axe");
|
|
|
+ woodTools.add("wood_hoe");
|
|
|
+ woodTools.add("wood_pickaxe");
|
|
|
+ woodTools.add("wood_shovel");
|
|
|
+
|
|
|
+ //Wood became wooden post 1.13
|
|
|
+ woodTools.add("wooden_sword");
|
|
|
+ woodTools.add("wooden_axe");
|
|
|
+ woodTools.add("wooden_hoe");
|
|
|
+ woodTools.add("wooden_pickaxe");
|
|
|
+ woodTools.add("wooden_shovel");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillStoneToolsWhiteList() {
|
|
|
+ stoneTools.add("stone_sword");
|
|
|
+ stoneTools.add("stone_axe");
|
|
|
+ stoneTools.add("stone_hoe");
|
|
|
+ stoneTools.add("stone_pickaxe");
|
|
|
+ stoneTools.add("stone_shovel");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillIronToolsWhiteList() {
|
|
|
+ ironTools.add("iron_sword");
|
|
|
+ ironTools.add("iron_axe");
|
|
|
+ ironTools.add("iron_hoe");
|
|
|
+ ironTools.add("iron_pickaxe");
|
|
|
+ ironTools.add("iron_shovel");
|
|
|
+
|
|
|
+ //Used for repair, remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ //TODO: Remove in 2.2
|
|
|
+ ironTools.add("bucket");
|
|
|
+ ironTools.add("flint_and_steel");
|
|
|
+ ironTools.add("shears");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillGoldToolsWhiteList() {
|
|
|
+ goldTools.add("gold_sword");
|
|
|
+ goldTools.add("gold_axe");
|
|
|
+ goldTools.add("gold_hoe");
|
|
|
+ goldTools.add("gold_pickaxe");
|
|
|
+ goldTools.add("gold_shovel");
|
|
|
+
|
|
|
+ //Gold became golden post 1.13
|
|
|
+ goldTools.add("golden_sword");
|
|
|
+ goldTools.add("golden_axe");
|
|
|
+ goldTools.add("golden_hoe");
|
|
|
+ goldTools.add("golden_pickaxe");
|
|
|
+ goldTools.add("golden_shovel");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillDiamondToolsWhiteList() {
|
|
|
+ diamondTools.add("diamond_sword");
|
|
|
+ diamondTools.add("diamond_axe");
|
|
|
+ diamondTools.add("diamond_hoe");
|
|
|
+ diamondTools.add("diamond_pickaxe");
|
|
|
+ diamondTools.add("diamond_shovel");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void fillnetheriteToolsWhiteList() {
|
|
|
+ netheriteTools.add("netherite_sword");
|
|
|
+ netheriteTools.add("netherite_axe");
|
|
|
+ netheriteTools.add("netherite_hoe");
|
|
|
+ netheriteTools.add("netherite_pickaxe");
|
|
|
+ netheriteTools.add("netherite_shovel");
|
|
|
}
|
|
|
|
|
|
private void fillGlassBlockWhiteList() {
|
|
@@ -161,6 +540,200 @@ public class MaterialMapStore {
|
|
|
foodItemWhiteList.add("tropical_fish");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Checks if a Material is used for Armor
|
|
|
+ * @param material target material
|
|
|
+ * @return true if it is used for armor
|
|
|
+ */
|
|
|
+ public boolean isArmor(Material material) {
|
|
|
+ return isArmor(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Checks if the id provided is used as armor
|
|
|
+ * @param id target item id
|
|
|
+ * @return true if the item id matches armor
|
|
|
+ */
|
|
|
+ public boolean isArmor(String id) {
|
|
|
+ return armors.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isTool(Material material) {
|
|
|
+ return isTool(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isTool(String id) {
|
|
|
+ return tools.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isEnchantable(Material material) {
|
|
|
+ return isEnchantable(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isEnchantable(String id) {
|
|
|
+ return enchantables.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isOre(Material material) {
|
|
|
+ return isOre(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isOre(String id) {
|
|
|
+ return ores.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isBow(Material material) {
|
|
|
+ return isBow(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isBow(String id) {
|
|
|
+ return bows.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isLeatherArmor(Material material) {
|
|
|
+ return isLeatherArmor(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isLeatherArmor(String id) {
|
|
|
+ return leatherArmor.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isIronArmor(Material material) {
|
|
|
+ return isIronArmor(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isIronArmor(String id) {
|
|
|
+ return ironArmor.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isGoldArmor(Material material) {
|
|
|
+ return isGoldArmor(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isGoldArmor(String id) {
|
|
|
+ return goldArmor.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isDiamondArmor(Material material) {
|
|
|
+ return isDiamondArmor(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isDiamondArmor(String id) {
|
|
|
+ return diamondArmor.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isChainmailArmor(Material material) {
|
|
|
+ return isChainmailArmor(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isChainmailArmor(String id) {
|
|
|
+ return chainmailArmor.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isNetheriteArmor(Material material) {
|
|
|
+ return isNetheriteArmor(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isNetheriteArmor(String id) {
|
|
|
+ return netheriteArmor.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isWoodTool(Material material) {
|
|
|
+ return isWoodTool(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isWoodTool(String id) {
|
|
|
+ return woodTools.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isStoneTool(Material material) {
|
|
|
+ return isStoneTool(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isStoneTool(String id) {
|
|
|
+ return stoneTools.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isIronTool(Material material) {
|
|
|
+ return isIronTool(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isIronTool(String id) {
|
|
|
+ return ironTools.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isGoldTool(Material material) {
|
|
|
+ return isGoldTool(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isGoldTool(String id) {
|
|
|
+ return goldTools.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isDiamondTool(Material material) {
|
|
|
+ return isDiamondTool(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isDiamondTool(String id) {
|
|
|
+ return diamondTools.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isSword(Material material) {
|
|
|
+ return isSword(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isSword(String id) {
|
|
|
+ return swords.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isAxe(Material material) {
|
|
|
+ return isAxe(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isAxe(String id) {
|
|
|
+ return axes.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isPickAxe(Material material) {
|
|
|
+ return isPickAxe(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isPickAxe(String id) {
|
|
|
+ return pickAxes.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isShovel(Material material) {
|
|
|
+ return isShovel(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isShovel(String id) {
|
|
|
+ return shovels.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isHoe(Material material) {
|
|
|
+ return isHoe(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isHoe(String id) {
|
|
|
+ return hoes.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isNetheriteTool(Material material) {
|
|
|
+ return isNetheriteTool(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isNetheriteTool(String id) {
|
|
|
+ return netheriteTools.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isStringTool(Material material) {
|
|
|
+ return isStringTool(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isStringTool(String id) {
|
|
|
+ return stringTools.contains(id);
|
|
|
+ }
|
|
|
+
|
|
|
public boolean isGlass(Material material) {
|
|
|
return glassBlocks.contains(material.getKey().getKey());
|
|
|
}
|
|
@@ -181,6 +754,8 @@ public class MaterialMapStore {
|
|
|
multiBlockPlant.add("large_fern");
|
|
|
multiBlockPlant.add("tall_grass");
|
|
|
multiBlockPlant.add("bamboo");
|
|
|
+ multiBlockPlant.add("weeping_vines_plant");
|
|
|
+ multiBlockPlant.add("twisted_vines_plant");
|
|
|
}
|
|
|
|
|
|
private void fillShroomyWhiteList() {
|
|
@@ -209,6 +784,8 @@ public class MaterialMapStore {
|
|
|
leavesWhiteList.add("dark_oak_leaves");
|
|
|
leavesWhiteList.add("jungle_leaves");
|
|
|
leavesWhiteList.add("spruce_leaves");
|
|
|
+ leavesWhiteList.add("nether_wart_block");
|
|
|
+ leavesWhiteList.add("warped_wart_block");
|
|
|
}
|
|
|
|
|
|
private void fillMossyWhiteList() {
|
|
@@ -219,7 +796,18 @@ public class MaterialMapStore {
|
|
|
mossyWhiteList.add("cobblestone_wall");
|
|
|
}
|
|
|
|
|
|
- private void fillAbilityBlackList() {
|
|
|
+ private void fillAbilityBlackList()
|
|
|
+ {
|
|
|
+ abilityBlackList.add("warped_fence_gate");
|
|
|
+ abilityBlackList.add("crimson_fence_gate");
|
|
|
+ abilityBlackList.add("warped_pressure_plate");
|
|
|
+ abilityBlackList.add("crimson_pressure_plate");
|
|
|
+ abilityBlackList.add("warped_button");
|
|
|
+ abilityBlackList.add("crimson_button");
|
|
|
+ abilityBlackList.add("warped_door");
|
|
|
+ abilityBlackList.add("crimson_door");
|
|
|
+ abilityBlackList.add("warped_trapdoor");
|
|
|
+ abilityBlackList.add("crimson_trapdoor");
|
|
|
abilityBlackList.add("black_bed");
|
|
|
abilityBlackList.add("blue_bed");
|
|
|
abilityBlackList.add("brown_bed");
|
|
@@ -473,6 +1061,14 @@ public class MaterialMapStore {
|
|
|
toolBlackList.add("stonecutter");
|
|
|
}
|
|
|
|
|
|
+ public int getTier(Material material) {
|
|
|
+ return getTier(material.getKey().getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getTier(String id) {
|
|
|
+ return tierValue.getOrDefault(id, 1); //1 for unknown items
|
|
|
+ }
|
|
|
+
|
|
|
private void addToHashSet(String string, HashSet<String> stringHashSet)
|
|
|
{
|
|
|
stringHashSet.add(string.toLowerCase(Locale.ENGLISH));
|