Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add c:flowers, c:flowers/tall, and c:flowers/small block and item tags #4352

Open
wants to merge 8 commits into
base: 1.21.4
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ boolean isVerbose() {
createMapEntry(RegistryKeys.ITEM, "candies", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CANDY_FOODS),
createMapEntry(RegistryKeys.ITEM, "pie", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.PIE_FOODS),
createMapEntry(RegistryKeys.ITEM, "pies", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.PIE_FOODS),
createMapEntry(TagKey.of(RegistryKeys.ITEM, Identifier.of("minecraft", "music_discs")), net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.MUSIC_DISCS)
createMapEntry(TagKey.of(RegistryKeys.ITEM, Identifier.of("minecraft", "music_discs")), net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.MUSIC_DISCS),
createMapEntry(TagKey.of(RegistryKeys.ITEM, Identifier.of("minecraft", "tall_flowers")), net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.TALL_FLOWERS),
createMapEntry(TagKey.of(RegistryKeys.ITEM, Identifier.of("minecraft", "flowers")), net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.FLOWERS),
createMapEntry(TagKey.of(RegistryKeys.BLOCK, Identifier.of("minecraft", "tall_flowers")), net.fabricmc.fabric.api.tag.convention.v2.ConventionalBlockTags.TALL_FLOWERS)
);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,37 @@ protected void configure(RegistryWrapper.WrapperLookup registries) {

generateHeadTags();

generateFlowerTags();

generateMiscTags();

generateTagAlias();

generateBackwardsCompatTags();
}

private void generateFlowerTags() {
getOrCreateTagBuilder(ConventionalBlockTags.SMALL_FLOWERS)
.add(Blocks.DANDELION, Blocks.POPPY, Blocks.BLUE_ORCHID,
Blocks.ALLIUM, Blocks.AZURE_BLUET, Blocks.RED_TULIP,
Blocks.ORANGE_TULIP, Blocks.WHITE_TULIP, Blocks.PINK_TULIP,
Blocks.OXEYE_DAISY, Blocks.CORNFLOWER, Blocks.LILY_OF_THE_VALLEY,
Blocks.WITHER_ROSE, Blocks.TORCHFLOWER, Blocks.OPEN_EYEBLOSSOM,
Blocks.CLOSED_EYEBLOSSOM
);

getOrCreateTagBuilder(ConventionalBlockTags.TALL_FLOWERS)
.add(Blocks.SUNFLOWER, Blocks.LILAC, Blocks.PEONY,
Blocks.ROSE_BUSH, Blocks.PITCHER_PLANT
).addOptional(Identifier.ofVanilla("tall_flowers"));

getOrCreateTagBuilder(ConventionalBlockTags.FLOWERS)
.add(Blocks.FLOWERING_AZALEA_LEAVES, Blocks.FLOWERING_AZALEA, Blocks.MANGROVE_PROPAGULE,
Blocks.PINK_PETALS, Blocks.CHORUS_FLOWER, Blocks.SPORE_BLOSSOM
).addOptionalTag(ConventionalBlockTags.SMALL_FLOWERS)
.addOptionalTag(ConventionalBlockTags.TALL_FLOWERS);
}

private void generateMiscTags() {
getOrCreateTagBuilder(ConventionalBlockTags.PLAYER_WORKSTATIONS_CRAFTING_TABLES)
.add(Blocks.CRAFTING_TABLE);
Expand Down Expand Up @@ -694,6 +718,9 @@ private void generateTagAlias() {
aliasGroup("fences").add(BlockTags.FENCES, ConventionalBlockTags.FENCES);
aliasGroup("fences/wooden").add(BlockTags.WOODEN_FENCES, ConventionalBlockTags.WOODEN_FENCES);
aliasGroup("fence_gates").add(BlockTags.FENCE_GATES, ConventionalBlockTags.FENCE_GATES);

aliasGroup("flowers/small").add(BlockTags.SMALL_FLOWERS, ConventionalBlockTags.SMALL_FLOWERS);
aliasGroup("flowers").add(BlockTags.FLOWERS, ConventionalBlockTags.FLOWERS);
TelepathicGrunt marked this conversation as resolved.
Show resolved Hide resolved
}

private void generateBackwardsCompatTags() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, T
translationBuilder.add(ConventionalBlockTags.UNCOLORED_SANDSTONE_BLOCKS, "Uncolored Sandstone Blocks");
translationBuilder.add(ConventionalBlockTags.UNCOLORED_SANDSTONE_SLABS, "Uncolored Sandstone Slabs");
translationBuilder.add(ConventionalBlockTags.UNCOLORED_SANDSTONE_STAIRS, "Uncolored Sandstone Stairs");
translationBuilder.add(ConventionalBlockTags.SMALL_FLOWERS, "Small Flowers");
translationBuilder.add(ConventionalBlockTags.TALL_FLOWERS, "Tall Flowers");
translationBuilder.add(ConventionalBlockTags.FLOWERS, "Flowers");
translationBuilder.add(ConventionalBlockTags.FENCES, "Fences");
translationBuilder.add(ConventionalBlockTags.WOODEN_FENCES, "Wooden Fences");
translationBuilder.add(ConventionalBlockTags.NETHER_BRICK_FENCES, "Nether Brick Fences");
Expand Down Expand Up @@ -318,6 +321,9 @@ public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, T
translationBuilder.add(ConventionalItemTags.UNCOLORED_SANDSTONE_BLOCKS, "Uncolored Sandstone Blocks");
translationBuilder.add(ConventionalItemTags.UNCOLORED_SANDSTONE_SLABS, "Uncolored Sandstone Slabs");
translationBuilder.add(ConventionalItemTags.UNCOLORED_SANDSTONE_STAIRS, "Uncolored Sandstone Stairs");
translationBuilder.add(ConventionalItemTags.SMALL_FLOWERS, "Small Flowers");
translationBuilder.add(ConventionalItemTags.TALL_FLOWERS, "Tall Flowers");
translationBuilder.add(ConventionalItemTags.FLOWERS, "Flowers");
translationBuilder.add(ConventionalItemTags.FENCES, "Fences");
translationBuilder.add(ConventionalItemTags.WOODEN_FENCES, "Wooden Fences");
translationBuilder.add(ConventionalItemTags.NETHER_BRICK_FENCES, "Nether Brick Fences");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ protected void configure(RegistryWrapper.WrapperLookup arg) {
generateDyedTags();
generateCropAndSeedsTags();
generateVillagerJobSites();
generateFlowerTags();
generateOtherTags();
copyItemTags();
generateTagAlias();
Expand Down Expand Up @@ -779,6 +780,12 @@ private void generateCropAndSeedsTags() {
.add(Items.WHEAT_SEEDS);
}

private void generateFlowerTags() {
copy(ConventionalBlockTags.SMALL_FLOWERS, ConventionalItemTags.SMALL_FLOWERS);
copy(ConventionalBlockTags.TALL_FLOWERS, ConventionalItemTags.TALL_FLOWERS);
copy(ConventionalBlockTags.FLOWERS, ConventionalItemTags.FLOWERS);
}

private void generateOtherTags() {
getOrCreateTagBuilder(ConventionalItemTags.PLAYER_WORKSTATIONS_CRAFTING_TABLES)
.add(Items.CRAFTING_TABLE);
Expand Down Expand Up @@ -978,6 +985,8 @@ private void generateTagAlias() {
aliasGroup("fences").add(ItemTags.FENCES, ConventionalItemTags.FENCES);
aliasGroup("fences/wooden").add(ItemTags.WOODEN_FENCES, ConventionalItemTags.WOODEN_FENCES);
aliasGroup("fence_gates").add(ItemTags.FENCE_GATES, ConventionalItemTags.FENCE_GATES);

aliasGroup("flowers/small").add(ItemTags.SMALL_FLOWERS, ConventionalItemTags.SMALL_FLOWERS);
}

private void generateBackwardsCompatTags() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"tag.block.c.fences": "Fences",
"tag.block.c.fences.nether_brick": "Nether Brick Fences",
"tag.block.c.fences.wooden": "Wooden Fences",
"tag.block.c.flowers": "Flowers",
"tag.block.c.flowers.small": "Small Flowers",
"tag.block.c.flowers.tall": "Tall Flowers",
"tag.block.c.glass_blocks": "Glass Blocks",
"tag.block.c.glass_blocks.cheap": "Cheap Glass Blocks",
"tag.block.c.glass_blocks.colorless": "Colorless Glass Blocks",
Expand Down Expand Up @@ -233,6 +236,9 @@
"tag.item.c.fences.nether_brick": "Nether Brick Fences",
"tag.item.c.fences.wooden": "Wooden Fences",
"tag.item.c.fertilizers": "Fertilizers",
"tag.item.c.flowers": "Flowers",
"tag.item.c.flowers.small": "Small Flowers",
"tag.item.c.flowers.tall": "Tall Flowers",
"tag.item.c.foods": "Foods",
"tag.item.c.foods.berries": "Berries",
"tag.item.c.foods.berry": "Berries",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"values": [
"minecraft:flowering_azalea_leaves",
"minecraft:flowering_azalea",
"minecraft:mangrove_propagule",
"minecraft:pink_petals",
"minecraft:chorus_flower",
"minecraft:spore_blossom",
{
"id": "#c:flowers/small",
"required": false
},
{
"id": "#c:flowers/tall",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"values": [
"minecraft:dandelion",
"minecraft:poppy",
"minecraft:blue_orchid",
"minecraft:allium",
"minecraft:azure_bluet",
"minecraft:red_tulip",
"minecraft:orange_tulip",
"minecraft:white_tulip",
"minecraft:pink_tulip",
"minecraft:oxeye_daisy",
"minecraft:cornflower",
"minecraft:lily_of_the_valley",
"minecraft:wither_rose",
"minecraft:torchflower",
"minecraft:open_eyeblossom",
"minecraft:closed_eyeblossom"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"values": [
"minecraft:sunflower",
"minecraft:lilac",
"minecraft:peony",
"minecraft:rose_bush",
"minecraft:pitcher_plant",
{
"id": "minecraft:tall_flowers",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"values": [
"minecraft:flowering_azalea_leaves",
"minecraft:flowering_azalea",
"minecraft:mangrove_propagule",
"minecraft:pink_petals",
"minecraft:chorus_flower",
"minecraft:spore_blossom",
{
"id": "#c:flowers/small",
"required": false
},
{
"id": "#c:flowers/tall",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"values": [
"minecraft:dandelion",
"minecraft:poppy",
"minecraft:blue_orchid",
"minecraft:allium",
"minecraft:azure_bluet",
"minecraft:red_tulip",
"minecraft:orange_tulip",
"minecraft:white_tulip",
"minecraft:pink_tulip",
"minecraft:oxeye_daisy",
"minecraft:cornflower",
"minecraft:lily_of_the_valley",
"minecraft:wither_rose",
"minecraft:torchflower",
"minecraft:open_eyeblossom",
"minecraft:closed_eyeblossom"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"values": [
"minecraft:sunflower",
"minecraft:lilac",
"minecraft:peony",
"minecraft:rose_bush",
"minecraft:pitcher_plant",
{
"id": "minecraft:tall_flowers",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tags": [
"minecraft:flowers",
"c:flowers"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tags": [
"minecraft:small_flowers",
"c:flowers/small"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tags": [
"minecraft:small_flowers",
"c:flowers/small"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.TagKey;

import net.fabricmc.fabric.impl.tag.convention.v2.TagRegistration;
Expand Down Expand Up @@ -56,37 +56,37 @@ private ConventionalBlockTags() {

// Ores - vanilla instances (All ores consolidated here for consistency)
/**
* Aliased with {@link ItemTags#COAL_ORES}.
* Aliased with {@link BlockTags#COAL_ORES}.
*/
public static final TagKey<Block> COAL_ORES = register("ores/coal");
/**
* Aliased with {@link ItemTags#COPPER_ORES}.
* Aliased with {@link BlockTags#COPPER_ORES}.
*/
public static final TagKey<Block> COPPER_ORES = register("ores/copper");
/**
* Aliased with {@link ItemTags#DIAMOND_ORES}.
* Aliased with {@link BlockTags#DIAMOND_ORES}.
*/
public static final TagKey<Block> DIAMOND_ORES = register("ores/diamond");
/**
* Aliased with {@link ItemTags#EMERALD_ORES}.
* Aliased with {@link BlockTags#EMERALD_ORES}.
*/
public static final TagKey<Block> EMERALD_ORES = register("ores/emerald");
/**
* Aliased with {@link ItemTags#GOLD_ORES}.
* Aliased with {@link BlockTags#GOLD_ORES}.
*/
public static final TagKey<Block> GOLD_ORES = register("ores/gold");
/**
* Aliased with {@link ItemTags#IRON_ORES}.
* Aliased with {@link BlockTags#IRON_ORES}.
*/
public static final TagKey<Block> IRON_ORES = register("ores/iron");
/**
* Aliased with {@link ItemTags#LAPIS_ORES}.
* Aliased with {@link BlockTags#LAPIS_ORES}.
*/
public static final TagKey<Block> LAPIS_ORES = register("ores/lapis");
public static final TagKey<Block> NETHERITE_SCRAP_ORES = register("ores/netherite_scrap");
public static final TagKey<Block> QUARTZ_ORES = register("ores/quartz");
/**
* Aliased with {@link ItemTags#REDSTONE_ORES}.
* Aliased with {@link BlockTags#REDSTONE_ORES}.
*/
public static final TagKey<Block> REDSTONE_ORES = register("ores/redstone");

Expand Down Expand Up @@ -130,6 +130,25 @@ private ConventionalBlockTags() {
public static final TagKey<Block> RED_SANDS = register("sands/red");
public static final TagKey<Block> COLORLESS_SANDS = register("sands/colorless");

// Flower
/**
* Contains living ground-based flowers that are 1 block tall such as Dandelions or Poppy.
* Equivalent to the "minecraft:small_flowers" block tag.
* Aliased with {@link BlockTags#SMALL_FLOWERS}.
*/
public static final TagKey<Block> SMALL_FLOWERS = register("flowers/small");
/**
* Contains living ground-based flowers that are 2 block tall such as Rose Bush or Peony.
* Equivalent to the "minecraft:tall_flowers" block tag in past Minecraft version.
*/
public static final TagKey<Block> TALL_FLOWERS = register("flowers/tall");
/**
* Contains any living plant block that contains flowers or is a flower itself.
* Equivalent to the "minecraft:flowers" block tag.
* Aliased with {@link BlockTags#FLOWERS}.
*/
public static final TagKey<Block> FLOWERS = register("flowers");

// Sandstone
public static final TagKey<Block> SANDSTONE_BLOCKS = register("sandstone/blocks");
public static final TagKey<Block> SANDSTONE_SLABS = register("sandstone/slabs");
Expand All @@ -143,16 +162,16 @@ private ConventionalBlockTags() {

// Fences and Fence Gates
/**
* Aliased with {@link ItemTags#FENCES}.
* Aliased with {@link BlockTags#FENCES}.
*/
public static final TagKey<Block> FENCES = register("fences");
/**
* Aliased with {@link ItemTags#WOODEN_FENCES}.
* Aliased with {@link BlockTags#WOODEN_FENCES}.
*/
public static final TagKey<Block> WOODEN_FENCES = register("fences/wooden");
public static final TagKey<Block> NETHER_BRICK_FENCES = register("fences/nether_brick");
/**
* Aliased with {@link ItemTags#FENCE_GATES}.
* Aliased with {@link BlockTags#FENCE_GATES}.
*/
public static final TagKey<Block> FENCE_GATES = register("fence_gates");
public static final TagKey<Block> WOODEN_FENCE_GATES = register("fence_gates/wooden");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,24 @@ private ConventionalItemTags() {
public static final TagKey<Item> UNCOLORED_SANDSTONE_SLABS = register("sandstone/uncolored_slabs");
public static final TagKey<Item> UNCOLORED_SANDSTONE_STAIRS = register("sandstone/uncolored_stairs");

// Flower
/**
* Contains living ground-based flowers that are 1 block tall such as Dandelions or Poppy.
* Equivalent to the "minecraft:small_flowers" item tag.
TelepathicGrunt marked this conversation as resolved.
Show resolved Hide resolved
* Aliased with {@link ItemTags#SMALL_FLOWERS}.
*/
public static final TagKey<Item> SMALL_FLOWERS = register("flowers/small");
/**
* Contains living ground-based flowers that are 2 block tall such as Rose Bush or Peony.
* Equivalent to the "minecraft:tall_flowers" item tag in past Minecraft version.
TelepathicGrunt marked this conversation as resolved.
Show resolved Hide resolved
*/
public static final TagKey<Item> TALL_FLOWERS = register("flowers/tall");
/**
* Contains any living plant block that contains flowers or is a flower itself.
* Equivalent to the "minecraft:flowers" item tag in past minecraft versions.
TelepathicGrunt marked this conversation as resolved.
Show resolved Hide resolved
*/
public static final TagKey<Item> FLOWERS = register("flowers");

// Fences and Fence Gates
/**
* Aliased with {@link ItemTags#FENCES}.
Expand Down