From 9d22c5fde0b2fd4cda25a851f63c97b11142b6a7 Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:46:54 -0400 Subject: [PATCH] Create `c:obsidians` block and item tag (#4088) * Create `c:obsidians` * Add obsidians subtags --- .../datagen/generators/BlockTagGenerator.java | 7 +++++++ .../datagen/generators/EnglishTagLangGenerator.java | 6 ++++++ .../datagen/generators/ItemTagGenerator.java | 3 +++ .../assets/fabric-convention-tags-v2/lang/en_us.json | 6 ++++++ .../resources/data/c/tags/block/obsidians.json | 12 ++++++++++++ .../data/c/tags/block/obsidians/crying.json | 5 +++++ .../data/c/tags/block/obsidians/normal.json | 5 +++++ .../resources/data/c/tags/item/obsidians.json | 12 ++++++++++++ .../resources/data/c/tags/item/obsidians/crying.json | 5 +++++ .../resources/data/c/tags/item/obsidians/normal.json | 5 +++++ .../api/tag/convention/v2/ConventionalBlockTags.java | 7 +++++++ .../api/tag/convention/v2/ConventionalItemTags.java | 7 +++++++ 12 files changed, 80 insertions(+) create mode 100644 fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians.json create mode 100644 fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians/crying.json create mode 100644 fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians/normal.json create mode 100644 fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians.json create mode 100644 fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians/crying.json create mode 100644 fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians/normal.json diff --git a/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/BlockTagGenerator.java b/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/BlockTagGenerator.java index f0e4f4bc3..e1d31e87b 100644 --- a/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/BlockTagGenerator.java +++ b/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/BlockTagGenerator.java @@ -68,6 +68,13 @@ public final class BlockTagGenerator extends FabricTagProvider.BlockTagProvider .add(Blocks.MOSSY_COBBLESTONE) .add(Blocks.COBBLED_DEEPSLATE) .add(Blocks.INFESTED_COBBLESTONE); + getOrCreateTagBuilder(ConventionalBlockTags.NORMAL_OBSIDIANS) + .add(Blocks.OBSIDIAN); + getOrCreateTagBuilder(ConventionalBlockTags.CRYING_OBSIDIANS) + .add(Blocks.CRYING_OBSIDIAN); + getOrCreateTagBuilder(ConventionalBlockTags.OBSIDIANS) + .addOptionalTag(ConventionalBlockTags.NORMAL_OBSIDIANS) + .addOptionalTag(ConventionalBlockTags.CRYING_OBSIDIANS); getOrCreateTagBuilder(ConventionalBlockTags.QUARTZ_ORES) .add(Blocks.NETHER_QUARTZ_ORE); 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 085961367..a93520876 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 @@ -40,6 +40,9 @@ public class EnglishTagLangGenerator extends FabricLanguageProvider { // Blocks translationBuilder.add(ConventionalBlockTags.STONES, "Stones"); translationBuilder.add(ConventionalBlockTags.COBBLESTONES, "Cobblestones"); + translationBuilder.add(ConventionalBlockTags.OBSIDIANS, "Obsidians"); + translationBuilder.add(ConventionalBlockTags.NORMAL_OBSIDIANS, "Normal Obsidians"); + translationBuilder.add(ConventionalBlockTags.CRYING_OBSIDIANS, "Crying Obsidians"); translationBuilder.add(ConventionalBlockTags.ORES, "Ores"); translationBuilder.add(ConventionalBlockTags.QUARTZ_ORES, "Quartz Ores"); translationBuilder.add(ConventionalBlockTags.NETHERITE_SCRAP_ORES, "Netherite Scrap Ores"); @@ -117,6 +120,9 @@ public class EnglishTagLangGenerator extends FabricLanguageProvider { // Items translationBuilder.add(ConventionalItemTags.STONES, "Stones"); translationBuilder.add(ConventionalItemTags.COBBLESTONES, "Cobblestones"); + translationBuilder.add(ConventionalItemTags.OBSIDIANS, "Obsidians"); + translationBuilder.add(ConventionalItemTags.NORMAL_OBSIDIANS, "Normal Obsidians"); + translationBuilder.add(ConventionalItemTags.CRYING_OBSIDIANS, "Crying Obsidians"); translationBuilder.add(ConventionalItemTags.TOOLS, "Tools"); translationBuilder.add(ConventionalItemTags.SHEAR_TOOLS, "Shears"); translationBuilder.add(ConventionalItemTags.SPEAR_TOOLS, "Spears"); 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 0f13aefe1..111a0bf2a 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 @@ -54,6 +54,9 @@ public final class ItemTagGenerator extends FabricTagProvider.ItemTagProvider { private void copyItemTags() { copy(ConventionalBlockTags.STONES, ConventionalItemTags.STONES); copy(ConventionalBlockTags.COBBLESTONES, ConventionalItemTags.COBBLESTONES); + copy(ConventionalBlockTags.OBSIDIANS, ConventionalItemTags.OBSIDIANS); + copy(ConventionalBlockTags.NORMAL_OBSIDIANS, ConventionalItemTags.NORMAL_OBSIDIANS); + copy(ConventionalBlockTags.CRYING_OBSIDIANS, ConventionalItemTags.CRYING_OBSIDIANS); copy(ConventionalBlockTags.BARRELS, ConventionalItemTags.BARRELS); copy(ConventionalBlockTags.WOODEN_BARRELS, ConventionalItemTags.WOODEN_BARRELS); copy(ConventionalBlockTags.BOOKSHELVES, ConventionalItemTags.BOOKSHELVES); 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 8f7779ff6..058d1ddaa 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 @@ -37,6 +37,9 @@ "tag.block.c.glazed_terracotta": "Glazed Terracotta", "tag.block.c.glazed_terracottas": "Glazed Terracottas", "tag.block.c.hidden_from_recipe_viewers": "Hidden From Recipe Viewers", + "tag.block.c.obsidians": "Obsidians", + "tag.block.c.obsidians.crying": "Crying Obsidians", + "tag.block.c.obsidians.normal": "Normal Obsidians", "tag.block.c.ores": "Ores", "tag.block.c.ores.netherite_scrap": "Netherite Scrap Ores", "tag.block.c.ores.quartz": "Quartz Ores", @@ -220,6 +223,9 @@ "tag.item.c.nuggets": "Nuggets", "tag.item.c.nuggets.gold": "Gold Nuggets", "tag.item.c.nuggets.iron": "Iron Nuggets", + "tag.item.c.obsidians": "Obsidians", + "tag.item.c.obsidians.crying": "Crying Obsidians", + "tag.item.c.obsidians.normal": "Normal Obsidians", "tag.item.c.ores": "Ores", "tag.item.c.ores.netherite_scrap": "Netherite Scrap Ores", "tag.item.c.ores.quartz": "Quartz Ores", diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians.json new file mode 100644 index 000000000..f21276b4f --- /dev/null +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians.json @@ -0,0 +1,12 @@ +{ + "values": [ + { + "id": "#c:obsidians/normal", + "required": false + }, + { + "id": "#c:obsidians/crying", + "required": false + } + ] +} \ No newline at end of file diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians/crying.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians/crying.json new file mode 100644 index 000000000..2e8b37a1b --- /dev/null +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians/crying.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:crying_obsidian" + ] +} \ No newline at end of file diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians/normal.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians/normal.json new file mode 100644 index 000000000..170248454 --- /dev/null +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/block/obsidians/normal.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:obsidian" + ] +} \ No newline at end of file diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians.json new file mode 100644 index 000000000..f21276b4f --- /dev/null +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians.json @@ -0,0 +1,12 @@ +{ + "values": [ + { + "id": "#c:obsidians/normal", + "required": false + }, + { + "id": "#c:obsidians/crying", + "required": false + } + ] +} \ No newline at end of file diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians/crying.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians/crying.json new file mode 100644 index 000000000..2e8b37a1b --- /dev/null +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians/crying.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:crying_obsidian" + ] +} \ No newline at end of file diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians/normal.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians/normal.json new file mode 100644 index 000000000..170248454 --- /dev/null +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/item/obsidians/normal.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:obsidian" + ] +} \ No newline at end of file diff --git a/fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalBlockTags.java b/fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalBlockTags.java index d3fb1ffa3..27c474011 100644 --- a/fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalBlockTags.java +++ b/fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalBlockTags.java @@ -35,6 +35,13 @@ public final class ConventionalBlockTags { */ public static final TagKey STONES = register("stones"); public static final TagKey COBBLESTONES = register("cobblestones"); + public static final TagKey OBSIDIANS = register("obsidians"); + /** + * For common obsidian that has no special quirks or behaviors. Ideal for recipe use. + * Crying Obsidian, for example, is a light block and harder to obtain. So it gets its own tag instead of being under normal tag. + */ + public static final TagKey NORMAL_OBSIDIANS = register("obsidians/normal"); + public static final TagKey CRYING_OBSIDIANS = register("obsidians/crying"); // Ores - broad categories public static final TagKey ORES = register("ores"); 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 74d8468e2..d6b8a90ae 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 @@ -36,6 +36,13 @@ public final class ConventionalItemTags { */ public static final TagKey STONES = register("stones"); public static final TagKey COBBLESTONES = register("cobblestones"); + public static final TagKey OBSIDIANS = register("obsidians"); + /** + * For common obsidian that has no special quirks or behaviors. Ideal for recipe use. + * Crying Obsidian, for example, is a light block and harder to obtain. So it gets its own tag instead of being under normal tag. + */ + public static final TagKey NORMAL_OBSIDIANS = register("obsidians/normal"); + public static final TagKey CRYING_OBSIDIANS = register("obsidians/crying"); // Tool tags public static final TagKey TOOLS = register("tools");