From 53ee34a43b1e7f17f73974d2200cd6f6be560fbe Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Tue, 21 Jan 2025 13:33:57 -0500 Subject: [PATCH] Add tagkey for `c:tools/wrench` (#4386) Addresses https://github.com/FabricMC/fabric/issues/4376 --- .../fabric/impl/tag/convention/ConventionLogWarnings.java | 3 ++- .../datagen/generators/EnglishTagLangGenerator.java | 1 + .../convention/datagen/generators/ItemTagGenerator.java | 3 +++ .../assets/fabric-convention-tags-v2/lang/en_us.json | 1 + .../src/generated/resources/data/c/tags/item/tools.json | 8 ++++++++ .../resources/data/c/tags/item/tools/wrench.json | 3 +++ .../api/tag/convention/v2/ConventionalItemTags.java | 1 + 7 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/tools/wrench.json diff --git a/deprecated/fabric-convention-tags-v1/src/main/java/net/fabricmc/fabric/impl/tag/convention/ConventionLogWarnings.java b/deprecated/fabric-convention-tags-v1/src/main/java/net/fabricmc/fabric/impl/tag/convention/ConventionLogWarnings.java index 61957464c7..e746017ba5 100644 --- a/deprecated/fabric-convention-tags-v1/src/main/java/net/fabricmc/fabric/impl/tag/convention/ConventionLogWarnings.java +++ b/deprecated/fabric-convention-tags-v1/src/main/java/net/fabricmc/fabric/impl/tag/convention/ConventionLogWarnings.java @@ -174,12 +174,13 @@ boolean isVerbose() { createMapEntry(RegistryKeys.ITEM, "hoes", ItemTags.HOES), createMapEntry(RegistryKeys.ITEM, "shovels", ItemTags.SHOVELS), createMapEntry(RegistryKeys.ITEM, "swords", ItemTags.SWORDS), - createMapEntry(RegistryKeys.ITEM, "wrenches", "tools/wrenches"), createMapEntry(createTagKeyUnderFabric(RegistryKeys.ITEM, "axes"), ItemTags.AXES), createMapEntry(createTagKeyUnderFabric(RegistryKeys.ITEM, "pickaxes"), ItemTags.PICKAXES), createMapEntry(createTagKeyUnderFabric(RegistryKeys.ITEM, "hoes"), ItemTags.HOES), createMapEntry(createTagKeyUnderFabric(RegistryKeys.ITEM, "shovels"), ItemTags.SHOVELS), createMapEntry(createTagKeyUnderFabric(RegistryKeys.ITEM, "swords"), ItemTags.SWORDS), + createMapEntry(RegistryKeys.ITEM, "wrenches", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.WRENCH_TOOLS), + createMapEntry(RegistryKeys.ITEM, "tools/wrenches", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.WRENCH_TOOLS), createMapEntry(RegistryKeys.ITEM, "barrel", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BARRELS), createMapEntry(RegistryKeys.ITEM, "chest", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CHESTS), createMapEntry(RegistryKeys.ITEM, "glass", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.GLASS_BLOCKS), diff --git a/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EnglishTagLangGenerator.java b/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EnglishTagLangGenerator.java index 0082ce1304..44bee032bd 100644 --- a/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EnglishTagLangGenerator.java +++ b/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EnglishTagLangGenerator.java @@ -180,6 +180,7 @@ public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, T translationBuilder.add(ConventionalItemTags.BRUSH_TOOLS, "Brushes"); translationBuilder.add(ConventionalItemTags.IGNITER_TOOLS, "Igniters"); translationBuilder.add(ConventionalItemTags.MACE_TOOLS, "Maces"); + translationBuilder.add(ConventionalItemTags.WRENCH_TOOLS, "Wrenches"); translationBuilder.add(ConventionalItemTags.MELEE_WEAPON_TOOLS, "Melee Weapons"); translationBuilder.add(ConventionalItemTags.RANGED_WEAPON_TOOLS, "Ranged Weapons"); translationBuilder.add(ConventionalItemTags.MINING_TOOL_TOOLS, "Mining Tools"); diff --git a/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/ItemTagGenerator.java b/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/ItemTagGenerator.java index fab5d8744f..bebe840be8 100644 --- a/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/ItemTagGenerator.java +++ b/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/ItemTagGenerator.java @@ -592,6 +592,8 @@ private void generateToolTags() { .addOptionalTag(ConventionalItemTags.SHEAR_TOOLS) .addOptionalTag(ConventionalItemTags.SHIELD_TOOLS) .addOptionalTag(ConventionalItemTags.SPEAR_TOOLS) + .addOptionalTag(ConventionalItemTags.MACE_TOOLS) + .addOptionalTag(ConventionalItemTags.WRENCH_TOOLS) .addOptionalTag(ConventionalItemTags.MINING_TOOL_TOOLS) .addOptionalTag(ConventionalItemTags.MELEE_WEAPON_TOOLS) .addOptionalTag(ConventionalItemTags.RANGED_WEAPON_TOOLS); @@ -621,6 +623,7 @@ private void generateToolTags() { .add(Items.FLINT_AND_STEEL); getOrCreateTagBuilder(ConventionalItemTags.MACE_TOOLS) .add(Items.MACE); + getOrCreateTagBuilder(ConventionalItemTags.WRENCH_TOOLS); getOrCreateTagBuilder(ConventionalItemTags.MINING_TOOL_TOOLS) .add(Items.WOODEN_PICKAXE) diff --git a/fabric-convention-tags-v2/src/generated/resources/assets/fabric-convention-tags-v2/lang/en_us.json b/fabric-convention-tags-v2/src/generated/resources/assets/fabric-convention-tags-v2/lang/en_us.json index 1ef3031b36..2cf7a04008 100644 --- a/fabric-convention-tags-v2/src/generated/resources/assets/fabric-convention-tags-v2/lang/en_us.json +++ b/fabric-convention-tags-v2/src/generated/resources/assets/fabric-convention-tags-v2/lang/en_us.json @@ -403,6 +403,7 @@ "tag.item.c.tools.shields": "Shields", "tag.item.c.tools.spear": "Spears", "tag.item.c.tools.spears": "Spears", + "tag.item.c.tools.wrench": "Wrenches", "tag.item.c.villager_job_sites": "Villager Job Sites", "tag.worldgen.biome.c.hidden_from_locator_selection": "Hidden From Locator Selection", "tag.worldgen.biome.c.is_aquatic": "Aquatic", diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/tools.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/tools.json index d255624dd0..9f6b31d00d 100644 --- a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/tools.json +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/tools.json @@ -52,6 +52,14 @@ "id": "#c:tools/spear", "required": false }, + { + "id": "#c:tools/mace", + "required": false + }, + { + "id": "#c:tools/wrench", + "required": false + }, { "id": "#c:tools/mining_tool", "required": false diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/tools/wrench.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/tools/wrench.json new file mode 100644 index 0000000000..f72d209df7 --- /dev/null +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/tools/wrench.json @@ -0,0 +1,3 @@ +{ + "values": [] +} \ No newline at end of file diff --git a/fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalItemTags.java b/fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalItemTags.java index 58d5f3defa..14de332a64 100644 --- a/fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalItemTags.java +++ b/fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalItemTags.java @@ -70,6 +70,7 @@ private ConventionalItemTags() { */ public static final TagKey IGNITER_TOOLS = register("tools/igniter"); public static final TagKey MACE_TOOLS = register("tools/mace"); + public static final TagKey WRENCH_TOOLS = register("tools/wrench"); // Action-based tool tags /**