Add c:bars/copper and c:bars/iron tags (#10810)

This commit is contained in:
Paint_Ninja 2026-04-15 22:20:21 +01:00 committed by GitHub
parent 03f928a3de
commit 478d8b3f18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 67 additions and 1 deletions

View file

@ -0,0 +1,7 @@
{
"values": [
"#c:bars/copper",
"#c:bars/iron",
"#minecraft:bars"
]
}

View file

@ -0,0 +1,12 @@
{
"values": [
"minecraft:copper_bars",
"minecraft:waxed_copper_bars",
"minecraft:exposed_copper_bars",
"minecraft:waxed_exposed_copper_bars",
"minecraft:weathered_copper_bars",
"minecraft:waxed_weathered_copper_bars",
"minecraft:oxidized_copper_bars",
"minecraft:waxed_oxidized_copper_bars"
]
}

View file

@ -0,0 +1,5 @@
{
"values": [
"minecraft:iron_bars"
]
}

View file

@ -0,0 +1,7 @@
{
"values": [
"#c:bars/copper",
"#c:bars/iron",
"#minecraft:bars"
]
}

View file

@ -0,0 +1,12 @@
{
"values": [
"minecraft:copper_bars",
"minecraft:waxed_copper_bars",
"minecraft:exposed_copper_bars",
"minecraft:waxed_exposed_copper_bars",
"minecraft:weathered_copper_bars",
"minecraft:waxed_weathered_copper_bars",
"minecraft:oxidized_copper_bars",
"minecraft:waxed_oxidized_copper_bars"
]
}

View file

@ -0,0 +1,5 @@
{
"values": [
"minecraft:iron_bars"
]
}

View file

@ -62,6 +62,12 @@ public class Tags {
// Forge only adopts `c` tags that are common across all loaders.
public static final TagKey<Block> BARRELS = cTag("barrels");
public static final TagKey<Block> BARRELS_WOODEN = cTag("barrels/wooden");
/**
* Equivalent to the "minecraft:bars" block tag.
*/
public static final TagKey<Block> BARS = cTag("bars");
public static final TagKey<Block> BARS_COPPER = cTag("bars/copper");
public static final TagKey<Block> BARS_IRON = cTag("bars/iron");
public static final TagKey<Block> BOOKSHELVES = cTag("bookshelves");
/**
* For blocks that are similar to amethyst where their budding block produces buds and cluster blocks
@ -349,6 +355,12 @@ public class Tags {
// Forge only adopts `c` tags that are common across all loaders.
public static final TagKey<Item> BARRELS = cTag("barrels");
public static final TagKey<Item> BARRELS_WOODEN = cTag("barrels/wooden");
/**
* Equivalent to the "minecraft:bars" item tag.
*/
public static final TagKey<Item> BARS = cTag("bars");
public static final TagKey<Item> BARS_COPPER = cTag("bars/copper");
public static final TagKey<Item> BARS_IRON = cTag("bars/iron");
public static final TagKey<Item> BONES = cTag("bones");
public static final TagKey<Item> BOOKSHELVES = cTag("bookshelves");
public static final TagKey<Item> BRICKS = cTag("bricks");

View file

@ -28,6 +28,12 @@ public abstract class ForgeBlockItemTagsProvider extends BlockItemTagsProvider {
.addTag(Tags.Blocks.BARRELS_WOODEN);
tag(Tags.Blocks.BARRELS_WOODEN, Tags.Items.BARRELS_WOODEN)
.add(Blocks.BARREL);
tag(Tags.Blocks.BARS_COPPER, Tags.Items.BARS_COPPER)
.addAll(Blocks.COPPER_BARS.asList());
tag(Tags.Blocks.BARS_IRON, Tags.Items.BARS_IRON)
.add(Blocks.IRON_BARS);
tag(Tags.Blocks.BARS, Tags.Items.BARS)
.addTags(Tags.Blocks.BARS_COPPER, Tags.Blocks.BARS_IRON, BlockTags.BARS);
tag(Tags.Blocks.BOOKSHELVES, Tags.Items.BOOKSHELVES)
.add(Blocks.BOOKSHELF);
tag(Tags.Blocks.BUDDING_BLOCKS, Tags.Items.BUDDING_BLOCKS)

View file

@ -70,7 +70,7 @@ public final class ForgeBlockTagsProvider extends VanillaBlockTagsProvider {
private void addColored(TagKey<Block> group, String pattern) {
String prefix = group.location().getPath().toUpperCase(Locale.ENGLISH) + '_';
for (var color : DyeColor.values()) {
var key = Identifier.fromNamespaceAndPath("minecraft", pattern.replace("{color}", color.getName()));
var key = Identifier.withDefaultNamespace(pattern.replace("{color}", color.getName()));
TagKey<Block> tag = getTag(prefix + color.getName());
var block = ForgeRegistries.BLOCKS.getValue(key);
if (block == null || block == Blocks.AIR)