Skip to content

Commit

Permalink
Add c:tools/melee_weapon, c:tools/ranged_weapon, and `c:tools/min…
Browse files Browse the repository at this point in the history
…ing_tool` tool tags (#1253)
  • Loading branch information
TelepathicGrunt authored Jul 11, 2024
1 parent fbee11a commit 200ddd2
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/generated/resources/assets/c/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@
"tag.item.c.tools.crossbow": "Crossbows",
"tag.item.c.tools.fishing_rod": "Fishing Rods",
"tag.item.c.tools.mace": "Maces",
"tag.item.c.tools.melee_weapon": "Melee Weapons",
"tag.item.c.tools.mining_tool": "Mining Tools",
"tag.item.c.tools.ranged_weapon": "Ranged Weapons",
"tag.item.c.tools.shear": "Shears",
"tag.item.c.tools.shield": "Shields",
"tag.item.c.tools.spear": "Spears",
Expand Down
4 changes: 4 additions & 0 deletions src/generated/resources/data/c/tags/item/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"#c:tools/shear",
"#c:tools/shield",
"#c:tools/spear",
"#c:tools/mace",
"#c:tools/mining_tool",
"#c:tools/melee_weapon",
"#c:tools/ranged_weapon",
{
"id": "#forge:tools",
"required": false
Expand Down
17 changes: 17 additions & 0 deletions src/generated/resources/data/c/tags/item/tools/melee_weapon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"values": [
"minecraft:wooden_sword",
"minecraft:stone_sword",
"minecraft:golden_sword",
"minecraft:iron_sword",
"minecraft:diamond_sword",
"minecraft:netherite_sword",
"minecraft:wooden_axe",
"minecraft:stone_axe",
"minecraft:golden_axe",
"minecraft:iron_axe",
"minecraft:diamond_axe",
"minecraft:netherite_axe",
"minecraft:mace"
]
}
10 changes: 10 additions & 0 deletions src/generated/resources/data/c/tags/item/tools/mining_tool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"values": [
"minecraft:wooden_pickaxe",
"minecraft:stone_pickaxe",
"minecraft:golden_pickaxe",
"minecraft:iron_pickaxe",
"minecraft:diamond_pickaxe",
"minecraft:netherite_pickaxe"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values": [
"minecraft:bow",
"minecraft:crossbow",
"minecraft:trident"
]
}
27 changes: 27 additions & 0 deletions src/main/java/net/neoforged/neoforge/common/Tags.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,33 @@ public static class Items {
* @see ItemAbilities
*/
public static final TagKey<Item> TOOLS_MACE = tag("tools/mace");
/**
* A tag containing melee-based weapons for recipes and loot tables.
* Do not use this tag for determining a tool's behavior in-code.
* Please use {@link ItemAbilities} instead for what action a tool can do.
*
* @see ItemAbility
* @see ItemAbilities
*/
public static final TagKey<Item> MELEE_WEAPON_TOOLS = tag("tools/melee_weapon");
/**
* A tag containing ranged-based weapons for recipes and loot tables.
* Do not use this tag for determining a tool's behavior in-code.
* Please use {@link ItemAbilities} instead for what action a tool can do.
*
* @see ItemAbility
* @see ItemAbilities
*/
public static final TagKey<Item> RANGED_WEAPON_TOOLS = tag("tools/ranged_weapon");
/**
* A tag containing mining-based tools for recipes and loot tables.
* Do not use this tag for determining a tool's behavior in-code.
* Please use {@link ItemAbilities} instead for what action a tool can do.
*
* @see ItemAbility
* @see ItemAbilities
*/
public static final TagKey<Item> MINING_TOOL_TOOLS = tag("tools/mining_tool");
/**
* Collects the 4 vanilla armor tags into one parent collection for ease.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,13 @@ public void addTags(HolderLookup.Provider lookupProvider) {
tag(Tags.Items.TOOLS_SHEAR).add(Items.SHEARS);
tag(Tags.Items.TOOLS_SPEAR).add(Items.TRIDENT);
tag(Tags.Items.TOOLS_IGNITER).add(Items.FLINT_AND_STEEL);
tag(Tags.Items.MINING_TOOL_TOOLS).add(Items.WOODEN_PICKAXE, Items.STONE_PICKAXE, Items.GOLDEN_PICKAXE, Items.IRON_PICKAXE, Items.DIAMOND_PICKAXE, Items.NETHERITE_PICKAXE);
tag(Tags.Items.MELEE_WEAPON_TOOLS).add(Items.WOODEN_SWORD, Items.STONE_SWORD, Items.GOLDEN_SWORD, Items.IRON_SWORD, Items.DIAMOND_SWORD, Items.NETHERITE_SWORD, Items.WOODEN_AXE, Items.STONE_AXE, Items.GOLDEN_AXE, Items.IRON_AXE, Items.DIAMOND_AXE, Items.NETHERITE_AXE, Items.MACE);
tag(Tags.Items.RANGED_WEAPON_TOOLS).add(Items.BOW, Items.CROSSBOW, Items.TRIDENT);
tag(Tags.Items.TOOLS)
.addTags(ItemTags.AXES, ItemTags.HOES, ItemTags.PICKAXES, ItemTags.SHOVELS, ItemTags.SWORDS)
.addTags(Tags.Items.TOOLS_BOW, Tags.Items.TOOLS_BRUSH, Tags.Items.TOOLS_CROSSBOW, Tags.Items.TOOLS_FISHING_ROD, Tags.Items.TOOLS_IGNITER, Tags.Items.TOOLS_SHEAR, Tags.Items.TOOLS_SHIELD, Tags.Items.TOOLS_SPEAR);
.addTags(Tags.Items.TOOLS_BOW, Tags.Items.TOOLS_BRUSH, Tags.Items.TOOLS_CROSSBOW, Tags.Items.TOOLS_FISHING_ROD, Tags.Items.TOOLS_IGNITER, Tags.Items.TOOLS_SHEAR, Tags.Items.TOOLS_SHIELD, Tags.Items.TOOLS_SPEAR, Tags.Items.TOOLS_MACE,
Tags.Items.MINING_TOOL_TOOLS, Tags.Items.MELEE_WEAPON_TOOLS, Tags.Items.RANGED_WEAPON_TOOLS);
tag(Tags.Items.ARMORS).addTags(ItemTags.HEAD_ARMOR, ItemTags.CHEST_ARMOR, ItemTags.LEG_ARMOR, ItemTags.FOOT_ARMOR);
tag(Tags.Items.ENCHANTABLES).addTags(ItemTags.ARMOR_ENCHANTABLE, ItemTags.EQUIPPABLE_ENCHANTABLE, ItemTags.WEAPON_ENCHANTABLE, ItemTags.SWORD_ENCHANTABLE, ItemTags.MINING_ENCHANTABLE, ItemTags.MINING_LOOT_ENCHANTABLE, ItemTags.FISHING_ENCHANTABLE, ItemTags.TRIDENT_ENCHANTABLE, ItemTags.BOW_ENCHANTABLE, ItemTags.CROSSBOW_ENCHANTABLE, ItemTags.FIRE_ASPECT_ENCHANTABLE, ItemTags.DURABILITY_ENCHANTABLE).addOptionalTag(ItemTags.MACE_ENCHANTABLE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ protected void addTranslations() {
add(Tags.Items.TOOLS_BRUSH, "Brushes");
add(Tags.Items.TOOLS_MACE, "Maces");
add(Tags.Items.TOOLS_SPEAR, "Spears");
add(Tags.Items.MELEE_WEAPON_TOOLS, "Melee Weapons");
add(Tags.Items.RANGED_WEAPON_TOOLS, "Ranged Weapons");
add(Tags.Items.MINING_TOOL_TOOLS, "Mining Tools");
add(Tags.Items.TOOLS, "Tools");
add(Tags.Items.ARMORS, "Armors");
add(Tags.Items.ENCHANTABLES, "Enchantables");
Expand Down

0 comments on commit 200ddd2

Please sign in to comment.