Add forge tags for tools and armors, these DO NOT replace ToolActions, and are designed just for Recipes. (#8914)

This commit is contained in:
Sirttas authored and GitHub committed 2022-08-05 11:32:53 -07:00
1 parent 3181b5da23
commit f182cb00c1
18 files changed
+273

No files matched your search

@@ -394,6 +394,125 @@ public class Tags
public static final TagKey<Item> STORAGE_BLOCKS_RAW_IRON = tag("storage_blocks/raw_iron");
public static final TagKey<Item> STORAGE_BLOCKS_REDSTONE = tag("storage_blocks/redstone");
public static final TagKey<Item> STRING = tag("string");
/**
* A tag containing all existing tools.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS = tag("tools");
/**
* A tag containing all existing swords.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_SWORDS = tag("tools/swords");
/**
* A tag containing all existing axes.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_AXES = tag("tools/axes");
/**
* A tag containing all existing pickaxes.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_PICKAXES = tag("tools/pickaxes");
/**
* A tag containing all existing shovels.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_SHOVELS = tag("tools/shovels");
/**
* A tag containing all existing hoes.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_HOES = tag("tools/hoes");
/**
* A tag containing all existing shields.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_SHIELDS = tag("tools/shields");
/**
* A tag containing all existing bows.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_BOWS = tag("tools/bows");
/**
* A tag containing all existing crossbows.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_CROSSBOWS = tag("tools/crossbows");
/**
* A tag containing all existing fishing rods.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_FISHING_RODS = tag("tools/fishing_rods");
/**
* A tag containing all existing tridents.
*
* Note: This tag is not an alternative or a substitute to {@link net.minecraftforge.common.ToolActions}.
*
* @see net.minecraftforge.common.ToolAction
* @see net.minecraftforge.common.ToolActions
*/
public static final TagKey<Item> TOOLS_TRIDENTS = tag("tools/tridents");
/**
* A tag containing all existing armors.
*/
public static final TagKey<Item> ARMORS = tag("armors");
/**
* A tag containing all existing helmets.
*/
public static final TagKey<Item> ARMORS_HELMETS = tag("armors/helmets");
/**
* A tag containing all chestplates.
*/
public static final TagKey<Item> ARMORS_CHESTPLATES = tag("armors/chestplates");
/**
* A tag containing all existing leggings.
*/
public static final TagKey<Item> ARMORS_LEGGINGS = tag("armors/leggings");
/**
* A tag containing all existing boots.
*/
public static final TagKey<Item> ARMORS_BOOTS = tag("armors/boots");
private static TagKey<Item> tag(String name)
{
@@ -153,6 +153,22 @@ public final class ForgeItemTagsProvider extends ItemTagsProvider
copy(Tags.Blocks.STORAGE_BLOCKS_RAW_IRON, Tags.Items.STORAGE_BLOCKS_RAW_IRON);
copy(Tags.Blocks.STORAGE_BLOCKS_NETHERITE, Tags.Items.STORAGE_BLOCKS_NETHERITE);
tag(Tags.Items.STRING).add(Items.STRING);
tag(Tags.Items.TOOLS_SWORDS).add(Items.WOODEN_SWORD, Items.STONE_SWORD, Items.IRON_SWORD, Items.GOLDEN_SWORD, Items.DIAMOND_SWORD, Items.NETHERITE_SWORD);
tag(Tags.Items.TOOLS_AXES).add(Items.WOODEN_AXE, Items.STONE_AXE, Items.IRON_AXE, Items.GOLDEN_AXE, Items.DIAMOND_AXE, Items.NETHERITE_AXE);
tag(Tags.Items.TOOLS_PICKAXES).add(Items.WOODEN_PICKAXE, Items.STONE_PICKAXE, Items.IRON_PICKAXE, Items.GOLDEN_PICKAXE, Items.DIAMOND_PICKAXE, Items.NETHERITE_PICKAXE);
tag(Tags.Items.TOOLS_SHOVELS).add(Items.WOODEN_SHOVEL, Items.STONE_SHOVEL, Items.IRON_SHOVEL, Items.GOLDEN_SHOVEL, Items.DIAMOND_SHOVEL, Items.NETHERITE_SHOVEL);
tag(Tags.Items.TOOLS_HOES).add(Items.WOODEN_HOE, Items.STONE_HOE, Items.IRON_HOE, Items.GOLDEN_HOE, Items.DIAMOND_HOE, Items.NETHERITE_HOE);
tag(Tags.Items.TOOLS_SHIELDS).add(Items.SHIELD);
tag(Tags.Items.TOOLS_BOWS).add(Items.BOW);
tag(Tags.Items.TOOLS_CROSSBOWS).add(Items.CROSSBOW);
tag(Tags.Items.TOOLS_FISHING_RODS).add(Items.FISHING_ROD);
tag(Tags.Items.TOOLS_TRIDENTS).add(Items.TRIDENT);
tag(Tags.Items.TOOLS).addTags(Tags.Items.TOOLS_SWORDS, Tags.Items.TOOLS_AXES, Tags.Items.TOOLS_PICKAXES, Tags.Items.TOOLS_SHOVELS, Tags.Items.TOOLS_HOES, Tags.Items.TOOLS_SHIELDS, Tags.Items.TOOLS_BOWS, Tags.Items.TOOLS_CROSSBOWS, Tags.Items.TOOLS_FISHING_RODS, Tags.Items.TOOLS_TRIDENTS);
tag(Tags.Items.ARMORS_HELMETS).add(Items.LEATHER_HELMET, Items.TURTLE_HELMET, Items.CHAINMAIL_HELMET, Items.IRON_HELMET, Items.GOLDEN_HELMET, Items.DIAMOND_HELMET, Items.NETHERITE_HELMET);
tag(Tags.Items.ARMORS_CHESTPLATES).add(Items.LEATHER_CHESTPLATE, Items.CHAINMAIL_CHESTPLATE, Items.IRON_CHESTPLATE, Items.GOLDEN_CHESTPLATE, Items.DIAMOND_CHESTPLATE, Items.NETHERITE_CHESTPLATE);
tag(Tags.Items.ARMORS_LEGGINGS).add(Items.LEATHER_LEGGINGS, Items.CHAINMAIL_LEGGINGS, Items.IRON_LEGGINGS, Items.GOLDEN_LEGGINGS, Items.DIAMOND_LEGGINGS, Items.NETHERITE_LEGGINGS);
tag(Tags.Items.ARMORS_BOOTS).add(Items.LEATHER_BOOTS, Items.CHAINMAIL_BOOTS, Items.IRON_BOOTS, Items.GOLDEN_BOOTS, Items.DIAMOND_BOOTS, Items.NETHERITE_BOOTS);
tag(Tags.Items.ARMORS).addTags(Tags.Items.ARMORS_HELMETS, Tags.Items.ARMORS_CHESTPLATES, Tags.Items.ARMORS_LEGGINGS, Tags.Items.ARMORS_BOOTS);
}
private void addColored(Consumer<TagKey<Item>> consumer, TagKey<Item> group, String pattern)