Skip to content

Commit

Permalink
Backport #1864 to 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TelepathicGrunt committed Jan 23, 2025
1 parent 49ef558 commit 9579ccd
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/generated/resources/assets/c/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@
"tag.item.c.tools.shear": "Shears",
"tag.item.c.tools.shield": "Shields",
"tag.item.c.tools.spear": "Spears",
"tag.item.c.tools.wrench": "Wrenches",
"tag.item.c.villager_job_sites": "Villager Job Sites",
"tag.item.neoforge.enchanting_fuels": "Enchanting Fuels",
"tag.worldgen.biome.c.hidden_from_locator_selection": "Hidden From Locator's Selection",
Expand Down
1 change: 1 addition & 0 deletions src/generated/resources/data/c/tags/item/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"#c:tools/shield",
"#c:tools/spear",
"#c:tools/mace",
"#c:tools/wrench",
"#c:tools/mining_tool",
"#c:tools/melee_weapon",
"#c:tools/ranged_weapon",
Expand Down
3 changes: 3 additions & 0 deletions src/generated/resources/data/c/tags/item/tools/wrench.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"values": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,11 @@ public enum LogWarningMode {
createForgeMapEntry(Registries.ITEM, "armors/chestplates", ItemTags.CHEST_ARMOR),
createForgeMapEntry(Registries.ITEM, "armors/leggings", ItemTags.LEG_ARMOR),
createForgeMapEntry(Registries.ITEM, "armors/boots", ItemTags.FOOT_ARMOR),
createForgeMapEntry(Registries.ITEM, "wrench", "tools/wrenches"),
createForgeMapEntry(Registries.ITEM, "wrenches", "tools/wrenches"),
createForgeMapEntry(Registries.ITEM, "tools/wrench", "tools/wrenches"),
createForgeMapEntry(Registries.ITEM, "tools/wrenches", "tools/wrenches"),
createForgeMapEntry(Registries.ITEM, "wrench", Tags.Items.TOOLS_WRENCH),
createForgeMapEntry(Registries.ITEM, "wrenches", Tags.Items.TOOLS_WRENCH),
createForgeMapEntry(Registries.ITEM, "tools/wrench", Tags.Items.TOOLS_WRENCH),
createForgeMapEntry(Registries.ITEM, "tools/wrenches", Tags.Items.TOOLS_WRENCH),
createMapEntry(Registries.ITEM, "c", "tools/wrenches", Tags.Items.TOOLS_WRENCH),
createForgeMapEntry(Registries.ITEM, "food", Tags.Items.FOODS),
createForgeMapEntry(Registries.ITEM, "foods", Tags.Items.FOODS),
createForgeMapEntry(Registries.ITEM, "fruit", Tags.Items.FOODS_FRUIT),
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/net/neoforged/neoforge/common/Tags.java
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,14 @@ public static class Items {
* @see ItemAbilities
*/
public static final TagKey<Item> TOOLS_MACE = tag("tools/mace");
/**
* A tag containing all existing wrenches. Do not use this tag for determining a tool's behavior.
* Please use {@link ItemAbilities} instead for what action a tool can do.
*
* @see ItemAbility
* @see ItemAbilities
*/
public static final TagKey<Item> TOOLS_WRENCH = tag("tools/wrench");
/**
* A tag containing melee-based weapons for recipes and loot tables.
* Tools are considered melee if they are intentionally intended to be used for melee attack as a primary purpose.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ 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.TOOLS_WRENCH);
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.MACE, Items.TRIDENT,
Expand All @@ -275,7 +276,9 @@ public void addTags(HolderLookup.Provider lookupProvider) {
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, Tags.Items.TOOLS_MACE,
.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.TOOLS_WRENCH,
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.MACE_ENCHANTABLE, ItemTags.FIRE_ASPECT_ENCHANTABLE, ItemTags.DURABILITY_ENCHANTABLE, ItemTags.VANISHING_ENCHANTABLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ protected void addTranslations() {
add(Tags.Items.TOOLS_MACE, "Maces");
add(Tags.Items.TOOLS_SPEAR, "Spears");
add(Tags.Items.TOOLS_IGNITER, "Igniters");
add(Tags.Items.TOOLS_WRENCH, "Wrenches");
add(Tags.Items.MELEE_WEAPON_TOOLS, "Melee Weapons");
add(Tags.Items.RANGED_WEAPON_TOOLS, "Ranged Weapons");
add(Tags.Items.MINING_TOOL_TOOLS, "Mining Tools");
Expand Down

0 comments on commit 9579ccd

Please sign in to comment.