Procházet zdrojové kódy

1.16 support part 3

nossr50 před 5 roky
rodič
revize
d585b1c2f7

+ 1 - 0
Changelog.txt

@@ -1,5 +1,6 @@
 Version 2.1.119
 Version 2.1.119
     1.16 Support
     1.16 Support
+    mcMMO is now aware of turtle shell and treats it appropriately
     Added 'Ancient_Debris' with a value of 7777 to mining experience tables in experience.yml
     Added 'Ancient_Debris' with a value of 7777 to mining experience tables in experience.yml
     Added 'Netherite_Scrap' to bonus drops for Mining in config.yml
     Added 'Netherite_Scrap' to bonus drops for Mining in config.yml
     Added 'Ancient_Debris' to bonus drops for Mining in config.yml
     Added 'Ancient_Debris' to bonus drops for Mining in config.yml

+ 22 - 305
src/main/java/com/gmail/nossr50/util/ItemUtils.java

@@ -22,15 +22,7 @@ public final class ItemUtils {
      * @return true if the item is a bow, false otherwise
      * @return true if the item is a bow, false otherwise
      */
      */
     public static boolean isBow(ItemStack item) {
     public static boolean isBow(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case BOW:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomBow(type);
-        }
+        return mcMMO.getMaterialMapStore().isBow(item.getType().getKey().getKey());
     }
     }
 
 
     public static boolean hasItemInEitherHand(Player player, Material material) {
     public static boolean hasItemInEitherHand(Player player, Material material) {
@@ -44,19 +36,7 @@ public final class ItemUtils {
      * @return true if the item is a sword, false otherwise
      * @return true if the item is a sword, false otherwise
      */
      */
     public static boolean isSword(ItemStack item) {
     public static boolean isSword(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_SWORD:
-            case GOLDEN_SWORD:
-            case IRON_SWORD:
-            case STONE_SWORD:
-            case WOODEN_SWORD:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomSword(type);
-        }
+        return mcMMO.getMaterialMapStore().isSword(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -66,19 +46,7 @@ public final class ItemUtils {
      * @return true if the item is a hoe, false otherwise
      * @return true if the item is a hoe, false otherwise
      */
      */
     public static boolean isHoe(ItemStack item) {
     public static boolean isHoe(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_HOE:
-            case GOLDEN_HOE:
-            case IRON_HOE:
-            case STONE_HOE:
-            case WOODEN_HOE:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomHoe(type);
-        }
+        return mcMMO.getMaterialMapStore().isHoe(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -88,19 +56,7 @@ public final class ItemUtils {
      * @return true if the item is a shovel, false otherwise
      * @return true if the item is a shovel, false otherwise
      */
      */
     public static boolean isShovel(ItemStack item) {
     public static boolean isShovel(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_SHOVEL:
-            case GOLDEN_SHOVEL:
-            case IRON_SHOVEL:
-            case STONE_SHOVEL:
-            case WOODEN_SHOVEL:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomShovel(type);
-        }
+        return mcMMO.getMaterialMapStore().isShovel(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -110,19 +66,7 @@ public final class ItemUtils {
      * @return true if the item is an axe, false otherwise
      * @return true if the item is an axe, false otherwise
      */
      */
     public static boolean isAxe(ItemStack item) {
     public static boolean isAxe(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_AXE:
-            case GOLDEN_AXE:
-            case IRON_AXE:
-            case STONE_AXE:
-            case WOODEN_AXE:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomAxe(type);
-        }
+        return mcMMO.getMaterialMapStore().isAxe(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -132,19 +76,7 @@ public final class ItemUtils {
      * @return true if the item is a pickaxe, false otherwise
      * @return true if the item is a pickaxe, false otherwise
      */
      */
     public static boolean isPickaxe(ItemStack item) {
     public static boolean isPickaxe(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_PICKAXE:
-            case GOLDEN_PICKAXE:
-            case IRON_PICKAXE:
-            case STONE_PICKAXE:
-            case WOODEN_PICKAXE:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomPickaxe(type);
-        }
+        return mcMMO.getMaterialMapStore().isPickAxe(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -161,94 +93,6 @@ public final class ItemUtils {
         return item.getType() == Material.AIR;
         return item.getType() == Material.AIR;
     }
     }
 
 
-    /**
-     * Checks if the item is a helmet.
-     *
-     * @param item Item to check
-     * @return true if the item is a helmet, false otherwise
-     */
-    public static boolean isHelmet(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_HELMET:
-            case GOLDEN_HELMET:
-            case IRON_HELMET:
-            case CHAINMAIL_HELMET:
-            case LEATHER_HELMET:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomHelmet(type);
-        }
-    }
-
-    /**
-     * Checks if the item is a chestplate.
-     *
-     * @param item Item to check
-     * @return true if the item is a chestplate, false otherwise
-     */
-    public static boolean isChestplate(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_CHESTPLATE:
-            case GOLDEN_CHESTPLATE:
-            case IRON_CHESTPLATE:
-            case CHAINMAIL_CHESTPLATE:
-            case LEATHER_CHESTPLATE:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomChestplate(type);
-        }
-    }
-
-    /**
-     * Checks if the item is a pair of pants.
-     *
-     * @param item Item to check
-     * @return true if the item is a pair of pants, false otherwise
-     */
-    public static boolean isLeggings(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_LEGGINGS:
-            case GOLDEN_LEGGINGS:
-            case IRON_LEGGINGS:
-            case CHAINMAIL_LEGGINGS:
-            case LEATHER_LEGGINGS:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomLeggings(type);
-        }
-    }
-
-    /**
-     * Checks if the item is a pair of boots.
-     *
-     * @param item Item to check
-     * @return true if the item is a pair of boots, false otherwise
-     */
-    public static boolean isBoots(ItemStack item) {
-        Material type = item.getType();
-
-        switch (type) {
-            case DIAMOND_BOOTS:
-            case GOLDEN_BOOTS:
-            case IRON_BOOTS:
-            case CHAINMAIL_BOOTS:
-            case LEATHER_BOOTS:
-                return true;
-
-            default:
-                return mcMMO.getModManager().isCustomBoots(type);
-        }
-    }
-
     /**
     /**
      * Checks to see if an item is a wearable armor piece.
      * Checks to see if an item is a wearable armor piece.
      *
      *
@@ -256,17 +100,7 @@ public final class ItemUtils {
      * @return true if the item is armor, false otherwise
      * @return true if the item is armor, false otherwise
      */
      */
     public static boolean isArmor(ItemStack item) {
     public static boolean isArmor(ItemStack item) {
-        return isHelmet(item) || isChestplate(item) || isLeggings(item) || isBoots(item);
-    }
-
-    /**
-     * Checks to see if an item is a wearable *vanilla* armor piece.
-     *
-     * @param item Item to check
-     * @return true if the item is armor, false otherwise
-     */
-    public static boolean isMinecraftArmor(ItemStack item) {
-        return isLeatherArmor(item) || isGoldArmor(item) || isIronArmor(item) || isDiamondArmor(item) || isNetherriteTool(item) || isChainmailArmor(item);
+        return mcMMO.getMaterialMapStore().isArmor(item.getType());
     }
     }
 
 
     /**
     /**
@@ -276,16 +110,7 @@ public final class ItemUtils {
      * @return true if the item is leather armor, false otherwise
      * @return true if the item is leather armor, false otherwise
      */
      */
     public static boolean isLeatherArmor(ItemStack item) {
     public static boolean isLeatherArmor(ItemStack item) {
-        switch (item.getType()) {
-            case LEATHER_BOOTS:
-            case LEATHER_CHESTPLATE:
-            case LEATHER_HELMET:
-            case LEATHER_LEGGINGS:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isLeatherArmor(item.getType());
     }
     }
 
 
     /**
     /**
@@ -295,16 +120,7 @@ public final class ItemUtils {
      * @return true if the item is gold armor, false otherwise
      * @return true if the item is gold armor, false otherwise
      */
      */
     public static boolean isGoldArmor(ItemStack item) {
     public static boolean isGoldArmor(ItemStack item) {
-        switch (item.getType()) {
-            case GOLDEN_BOOTS:
-            case GOLDEN_CHESTPLATE:
-            case GOLDEN_HELMET:
-            case GOLDEN_LEGGINGS:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isGoldArmor(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -314,16 +130,7 @@ public final class ItemUtils {
      * @return true if the item is iron armor, false otherwise
      * @return true if the item is iron armor, false otherwise
      */
      */
     public static boolean isIronArmor(ItemStack item) {
     public static boolean isIronArmor(ItemStack item) {
-        switch (item.getType()) {
-            case IRON_BOOTS:
-            case IRON_CHESTPLATE:
-            case IRON_HELMET:
-            case IRON_LEGGINGS:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isIronArmor(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -333,24 +140,15 @@ public final class ItemUtils {
      * @return true if the item is diamond armor, false otherwise
      * @return true if the item is diamond armor, false otherwise
      */
      */
     public static boolean isDiamondArmor(ItemStack item) {
     public static boolean isDiamondArmor(ItemStack item) {
-        switch (item.getType()) {
-            case DIAMOND_BOOTS:
-            case DIAMOND_CHESTPLATE:
-            case DIAMOND_HELMET:
-            case DIAMOND_LEGGINGS:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isDiamondArmor(item.getType().getKey().getKey());
     }
     }
 
 
     public static boolean isNetherriteArmor(ItemStack itemStack) {
     public static boolean isNetherriteArmor(ItemStack itemStack) {
-        return mcMMO.getMaterialMapStore().isNetherriteArmor(itemStack.getType());
+        return mcMMO.getMaterialMapStore().isNetherriteArmor(itemStack.getType().getKey().getKey());
     }
     }
 
 
     public static boolean isNetherriteTool(ItemStack itemStack) {
     public static boolean isNetherriteTool(ItemStack itemStack) {
-        return mcMMO.getMaterialMapStore().isNetherriteTool(itemStack.getType());
+        return mcMMO.getMaterialMapStore().isNetherriteTool(itemStack.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -360,16 +158,7 @@ public final class ItemUtils {
      * @return true if the item is chainmail armor, false otherwise
      * @return true if the item is chainmail armor, false otherwise
      */
      */
     public static boolean isChainmailArmor(ItemStack item) {
     public static boolean isChainmailArmor(ItemStack item) {
-        switch (item.getType()) {
-            case CHAINMAIL_BOOTS:
-            case CHAINMAIL_CHESTPLATE:
-            case CHAINMAIL_HELMET:
-            case CHAINMAIL_LEGGINGS:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isChainmailArmor(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -379,7 +168,7 @@ public final class ItemUtils {
      * @return true if the item is a tool, false otherwise
      * @return true if the item is a tool, false otherwise
      */
      */
     public static boolean isMinecraftTool(ItemStack item) {
     public static boolean isMinecraftTool(ItemStack item) {
-        return isStoneTool(item) || isWoodTool(item) || isGoldTool(item) || isIronTool(item) || isDiamondTool(item) || isNetherriteTool(item) || isStringTool(item) || item.getType() == Material.TRIDENT;
+        return mcMMO.getMaterialMapStore().isTool(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -389,17 +178,7 @@ public final class ItemUtils {
      * @return true if the item is a stone tool, false otherwise
      * @return true if the item is a stone tool, false otherwise
      */
      */
     public static boolean isStoneTool(ItemStack item) {
     public static boolean isStoneTool(ItemStack item) {
-        switch (item.getType()) {
-            case STONE_AXE:
-            case STONE_HOE:
-            case STONE_PICKAXE:
-            case STONE_SHOVEL:
-            case STONE_SWORD:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isStoneTool(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -409,17 +188,7 @@ public final class ItemUtils {
      * @return true if the item is a wooden tool, false otherwise
      * @return true if the item is a wooden tool, false otherwise
      */
      */
     public static boolean isWoodTool(ItemStack item) {
     public static boolean isWoodTool(ItemStack item) {
-        switch (item.getType()) {
-            case WOODEN_AXE:
-            case WOODEN_HOE:
-            case WOODEN_PICKAXE:
-            case WOODEN_SHOVEL:
-            case WOODEN_SWORD:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isWoodTool(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -429,15 +198,7 @@ public final class ItemUtils {
      * @return true if the item is a string tool, false otherwise
      * @return true if the item is a string tool, false otherwise
      */
      */
     public static boolean isStringTool(ItemStack item) {
     public static boolean isStringTool(ItemStack item) {
-        switch (item.getType()) {
-            case BOW:
-            case CARROT_ON_A_STICK:
-            case FISHING_ROD:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isStringTool(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -447,17 +208,7 @@ public final class ItemUtils {
      * @return true if the item is a stone tool, false otherwise
      * @return true if the item is a stone tool, false otherwise
      */
      */
     public static boolean isGoldTool(ItemStack item) {
     public static boolean isGoldTool(ItemStack item) {
-        switch (item.getType()) {
-            case GOLDEN_AXE:
-            case GOLDEN_HOE:
-            case GOLDEN_PICKAXE:
-            case GOLDEN_SHOVEL:
-            case GOLDEN_SWORD:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isGoldTool(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -467,20 +218,7 @@ public final class ItemUtils {
      * @return true if the item is an iron tool, false otherwise
      * @return true if the item is an iron tool, false otherwise
      */
      */
     public static boolean isIronTool(ItemStack item) {
     public static boolean isIronTool(ItemStack item) {
-        switch (item.getType()) {
-            case BUCKET:
-            case FLINT_AND_STEEL:
-            case IRON_AXE:
-            case IRON_HOE:
-            case IRON_PICKAXE:
-            case IRON_SHOVEL:
-            case IRON_SWORD:
-            case SHEARS:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isIronTool(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -490,17 +228,7 @@ public final class ItemUtils {
      * @return true if the item is a diamond tool, false otherwise
      * @return true if the item is a diamond tool, false otherwise
      */
      */
     public static boolean isDiamondTool(ItemStack item) {
     public static boolean isDiamondTool(ItemStack item) {
-        switch (item.getType()) {
-            case DIAMOND_AXE:
-            case DIAMOND_HOE:
-            case DIAMOND_PICKAXE:
-            case DIAMOND_SHOVEL:
-            case DIAMOND_SWORD:
-                return true;
-
-            default:
-                return false;
-        }
+        return mcMMO.getMaterialMapStore().isDiamondTool(item.getType().getKey().getKey());
     }
     }
 
 
     /**
     /**
@@ -510,18 +238,7 @@ public final class ItemUtils {
      * @return true if the item is enchantable, false otherwise
      * @return true if the item is enchantable, false otherwise
      */
      */
     public static boolean isEnchantable(ItemStack item) {
     public static boolean isEnchantable(ItemStack item) {
-        switch (item.getType()) {
-            case ENCHANTED_BOOK:
-            case SHEARS:
-            case FISHING_ROD:
-            case CARROT_ON_A_STICK:
-            case FLINT_AND_STEEL:
-            case TRIDENT:
-                return true;
-
-            default:
-                return isArmor(item) || isSword(item) || isAxe(item) || isShovel(item) || isPickaxe(item) || isBow(item);
-        }
+        return mcMMO.getMaterialMapStore().isEnchantable(item.getType().getKey().getKey());
     }
     }
 
 
     public static boolean isSmeltable(ItemStack item) {
     public static boolean isSmeltable(ItemStack item) {

+ 521 - 9
src/main/java/com/gmail/nossr50/util/MaterialMapStore.java

@@ -24,8 +24,35 @@ public class MaterialMapStore {
     private HashSet<String> multiBlockPlant;
     private HashSet<String> multiBlockPlant;
     private HashSet<String> foodItemWhiteList;
     private HashSet<String> foodItemWhiteList;
     private HashSet<String> glassBlocks;
     private HashSet<String> glassBlocks;
+
     private HashSet<String> netherriteArmor;
     private HashSet<String> netherriteArmor;
     private HashSet<String> netherriteTools;
     private HashSet<String> netherriteTools;
+    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;
+
 
 
     public MaterialMapStore()
     public MaterialMapStore()
     {
     {
@@ -39,8 +66,35 @@ public class MaterialMapStore {
         multiBlockPlant = new HashSet<>();
         multiBlockPlant = new HashSet<>();
         foodItemWhiteList = new HashSet<>();
         foodItemWhiteList = new HashSet<>();
         glassBlocks = new HashSet<>();
         glassBlocks = new HashSet<>();
+
+        leatherArmor = new HashSet<>();
+        ironArmor = new HashSet<>();
+        chainmailArmor = new HashSet<>();
+        goldArmor = new HashSet<>();
+        diamondArmor = new HashSet<>();
         netherriteArmor = new HashSet<>();
         netherriteArmor = new HashSet<>();
+        armors = new HashSet<>();
+
+        woodTools = new HashSet<>();
+        stoneTools = new HashSet<>();
+        ironTools = new HashSet<>();
+        goldTools = new HashSet<>();
+        diamondTools = new HashSet<>();
         netherriteTools = new HashSet<>();
         netherriteTools = 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<>();
 
 
         fillHardcodedHashSets();
         fillHardcodedHashSets();
     }
     }
@@ -97,22 +151,294 @@ public class MaterialMapStore {
         fillMultiBlockPlantSet();
         fillMultiBlockPlantSet();
         fillFoodWhiteList();
         fillFoodWhiteList();
         fillGlassBlockWhiteList();
         fillGlassBlockWhiteList();
-        fillNetherriteWhiteList();
+        fillArmors();
+        fillTools();
+        fillEnchantables();
+        fillOres();
     }
     }
 
 
-    private void fillNetherriteWhiteList() {
-        netherriteTools.add("netherrite_sword");
-        netherriteTools.add("netherrite_axe");
-        netherriteTools.add("netherrite_hoe");
-        netherriteTools.add("netherrite_pickaxe");
-        netherriteTools.add("netherrite_shovel");
+    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();
+        fillNetherriteArmorWhiteList();
+
+        //Add all armors to armors hashset
+        armors.addAll(leatherArmor);
+        armors.addAll(ironArmor);
+        armors.addAll(chainmailArmor);
+        armors.addAll(goldArmor);
+        armors.addAll(diamondArmor);
+        armors.addAll(netherriteArmor);
+
+        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();
+        fillNetherriteToolsWhiteList();
+
+        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(netherriteTools);
+        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("netherrite_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("netherrite_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("netherrite_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("netherrite_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("netherrite_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 fillNetherriteArmorWhiteList() {
         netherriteArmor.add("netherrite_helmet");
         netherriteArmor.add("netherrite_helmet");
         netherriteArmor.add("netherrite_chestplate");
         netherriteArmor.add("netherrite_chestplate");
         netherriteArmor.add("netherrite_leggings");
         netherriteArmor.add("netherrite_leggings");
         netherriteArmor.add("netherrite_boots");
         netherriteArmor.add("netherrite_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 fillNetherriteToolsWhiteList() {
+        netherriteTools.add("netherrite_sword");
+        netherriteTools.add("netherrite_axe");
+        netherriteTools.add("netherrite_hoe");
+        netherriteTools.add("netherrite_pickaxe");
+        netherriteTools.add("netherrite_shovel");
+    }
+
     private void fillGlassBlockWhiteList() {
     private void fillGlassBlockWhiteList() {
         glassBlocks.add("glass");
         glassBlocks.add("glass");
         glassBlocks.add("glass_pane");
         glassBlocks.add("glass_pane");
@@ -189,12 +515,198 @@ public class MaterialMapStore {
         foodItemWhiteList.add("tropical_fish");
         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 isNetherriteArmor(Material material) {
     public boolean isNetherriteArmor(Material material) {
-        return netherriteArmor.contains(material.getKey().getKey());
+        return isNetherriteArmor(material.getKey().getKey());
+    }
+
+    public boolean isNetherriteArmor(String id) {
+        return netherriteArmor.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 isNetherriteTool(Material material) {
     public boolean isNetherriteTool(Material material) {
-        return netherriteTools.contains(material.getKey().getKey());
+        return isNetherriteTool(material.getKey().getKey());
+    }
+
+    public boolean isNetherriteTool(String id) {
+        return netherriteTools.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) {
     public boolean isGlass(Material material) {

+ 1 - 17
src/main/java/com/gmail/nossr50/util/MaterialUtils.java

@@ -7,22 +7,6 @@ public final class MaterialUtils {
     private MaterialUtils() {}
     private MaterialUtils() {}
 
 
     protected static boolean isOre(Material data) {
     protected static boolean isOre(Material data) {
-        //Netherrite Ore (Kind of)
-        if(data.getKey().getKey().equalsIgnoreCase("ancient_debris"))
-            return true;
-
-        switch (data) {
-            case COAL_ORE:
-            case DIAMOND_ORE:
-            case NETHER_QUARTZ_ORE:
-            case GOLD_ORE:
-            case IRON_ORE:
-            case LAPIS_ORE:
-            case REDSTONE_ORE:
-            case EMERALD_ORE:
-                return true;
-            default:
-                return mcMMO.getModManager().isCustomOre(data);
-        }
+        return mcMMO.getMaterialMapStore().isOre(data.getKey().getKey());
     }
     }
 }
 }