Skip to content

Commit

Permalink
Tag cleanup and additions for 1.21 (#3807)
Browse files Browse the repository at this point in the history
* Tag cleanup and additions for 1.21

Closes #3742
Closes #3755
Closes #3790
Closes #3731

* Fixed music disc javadoc

* Re-add redundant tags but deprecate them

* remove eroded badlands from sparse vegetation

* Switched to singular name for inner files for tools

* deprecate redundant shulker box tag

* Added glazed terracotta tag

* Added concrete and concrete powder tags

* checkstyle issue
  • Loading branch information
TelepathicGrunt authored Jun 8, 2024
1 parent 98a7dbb commit 18dd60f
Show file tree
Hide file tree
Showing 32 changed files with 608 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.Identifier;
Expand Down Expand Up @@ -115,10 +116,10 @@ private enum LogWarningMode {
createMapEntry(ConventionalItemTags.LAPIS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.LAPIS_GEMS),
createMapEntry(ConventionalItemTags.EMERALDS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.EMERALD_GEMS),
createMapEntry(ConventionalItemTags.QUARTZ, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.QUARTZ_GEMS),
createMapEntry(ConventionalItemTags.SHEARS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SHEARS_TOOLS),
createMapEntry(ConventionalItemTags.SPEARS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SPEARS_TOOLS),
createMapEntry(ConventionalItemTags.BOWS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BOWS_TOOLS),
createMapEntry(ConventionalItemTags.SHIELDS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SHIELDS_TOOLS),
createMapEntry(ConventionalItemTags.SHEARS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SHEAR_TOOLS),
createMapEntry(ConventionalItemTags.SPEARS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SPEAR_TOOLS),
createMapEntry(ConventionalItemTags.BOWS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BOW_TOOLS),
createMapEntry(ConventionalItemTags.SHIELDS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SHIELD_TOOLS),

createMapEntry(ConventionalEnchantmentTags.INCREASES_BLOCK_DROPS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalEnchantmentTags.INCREASE_BLOCK_DROPS),
createMapEntry(ConventionalEnchantmentTags.INCREASES_ENTITY_DROPS, net.fabricmc.fabric.api.tag.convention.v2.ConventionalEnchantmentTags.INCREASE_ENTITY_DROPS),
Expand Down Expand Up @@ -209,8 +210,26 @@ private enum LogWarningMode {
createMapEntry(RegistryKeys.ITEM, "stew", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUPS_FOODS),
createMapEntry(RegistryKeys.ITEM, "stews", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUPS_FOODS),
createMapEntry(RegistryKeys.ITEM, "candy", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CANDIES_FOODS),
createMapEntry(RegistryKeys.ITEM, "candies", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CANDIES_FOODS)

createMapEntry(RegistryKeys.ITEM, "candies", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CANDIES_FOODS),
createMapEntry(TagKey.of(RegistryKeys.ITEM, Identifier.of("minecraft", "music_discs")), net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.MUSIC_DISCS),

// V2 tags that are now discouraged
createMapEntry(ConventionalItemTags.COAL, ItemTags.COALS),
createMapEntry(RegistryKeys.ITEM, "tools/shears", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SHEAR_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/spears", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SPEAR_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/bows", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BOW_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/crossbows", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CROSSBOW_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/shields", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SHIELD_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/fishing_rods", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.FISHING_ROD_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/brushes", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BRUSH_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/melee_weapons", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.MELEE_WEAPON_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/ranged_weapons", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RANGED_WEAPON_TOOLS),
createMapEntry(RegistryKeys.ITEM, "tools/mining_tools", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.MINING_TOOL_TOOLS),
createMapEntry(RegistryKeys.ITEM, "raw_blocks", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.STORAGE_BLOCKS),
createMapEntry(RegistryKeys.ITEM, "raw_blocks/copper", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.STORAGE_BLOCKS_RAW_COPPER),
createMapEntry(RegistryKeys.ITEM, "raw_blocks/gold", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.STORAGE_BLOCKS_RAW_GOLD),
createMapEntry(RegistryKeys.ITEM, "raw_blocks/iron", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.STORAGE_BLOCKS_RAW_IRON),
createMapEntry(net.fabricmc.fabric.api.tag.convention.v2.ConventionalBlockTags.SHULKER_BOXES, BlockTags.SHULKER_BOXES)
);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ private void generateClimateAndVegetationTags() {

getOrCreateTagBuilder(ConventionalBiomeTags.IS_VEGETATION_SPARSE_OVERWORLD)
.add(BiomeKeys.WOODED_BADLANDS)
.add(BiomeKeys.ERODED_BADLANDS)
.add(BiomeKeys.SAVANNA)
.add(BiomeKeys.SAVANNA_PLATEAU)
.add(BiomeKeys.WINDSWEPT_SAVANNA)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ protected void configure(RegistryWrapper.WrapperLookup registries) {
getOrCreateTagBuilder(ConventionalBlockTags.BOOKSHELVES)
.add(Blocks.BOOKSHELF);
generateGlassTags();
generateShulkerTag();
generateGlazeTerracottaTags();
generateConcreteTags();
getOrCreateTagBuilder(ConventionalBlockTags.WOODEN_BARRELS)
.add(Blocks.BARREL);
getOrCreateTagBuilder(ConventionalBlockTags.BARRELS)
Expand Down Expand Up @@ -182,27 +183,6 @@ private void generateBuddingTags() {
.add(Blocks.AMETHYST_CLUSTER);
}

private void generateShulkerTag() {
getOrCreateTagBuilder(ConventionalBlockTags.SHULKER_BOXES)
.add(Blocks.SHULKER_BOX)
.add(Blocks.WHITE_SHULKER_BOX)
.add(Blocks.ORANGE_SHULKER_BOX)
.add(Blocks.MAGENTA_SHULKER_BOX)
.add(Blocks.LIGHT_BLUE_SHULKER_BOX)
.add(Blocks.YELLOW_SHULKER_BOX)
.add(Blocks.LIME_SHULKER_BOX)
.add(Blocks.PINK_SHULKER_BOX)
.add(Blocks.GRAY_SHULKER_BOX)
.add(Blocks.LIGHT_GRAY_SHULKER_BOX)
.add(Blocks.CYAN_SHULKER_BOX)
.add(Blocks.PURPLE_SHULKER_BOX)
.add(Blocks.BLUE_SHULKER_BOX)
.add(Blocks.BROWN_SHULKER_BOX)
.add(Blocks.GREEN_SHULKER_BOX)
.add(Blocks.RED_SHULKER_BOX)
.add(Blocks.BLACK_SHULKER_BOX);
}

private void generateGlassTags() {
getOrCreateTagBuilder(ConventionalBlockTags.GLASS_BLOCKS)
.add(Blocks.GLASS)
Expand Down Expand Up @@ -243,6 +223,46 @@ private void generateGlassTags() {
.add(Blocks.RED_STAINED_GLASS_PANE);
}

private void generateGlazeTerracottaTags() {
getOrCreateTagBuilder(ConventionalBlockTags.GLAZED_TERRACOTTA)
.add(Blocks.WHITE_GLAZED_TERRACOTTA)
.add(Blocks.ORANGE_GLAZED_TERRACOTTA)
.add(Blocks.MAGENTA_GLAZED_TERRACOTTA)
.add(Blocks.LIGHT_BLUE_GLAZED_TERRACOTTA)
.add(Blocks.YELLOW_GLAZED_TERRACOTTA)
.add(Blocks.LIME_GLAZED_TERRACOTTA)
.add(Blocks.PINK_GLAZED_TERRACOTTA)
.add(Blocks.GRAY_GLAZED_TERRACOTTA)
.add(Blocks.LIGHT_GRAY_GLAZED_TERRACOTTA)
.add(Blocks.CYAN_GLAZED_TERRACOTTA)
.add(Blocks.PURPLE_GLAZED_TERRACOTTA)
.add(Blocks.BLUE_GLAZED_TERRACOTTA)
.add(Blocks.BROWN_GLAZED_TERRACOTTA)
.add(Blocks.GREEN_GLAZED_TERRACOTTA)
.add(Blocks.BLACK_GLAZED_TERRACOTTA)
.add(Blocks.RED_GLAZED_TERRACOTTA);
}

private void generateConcreteTags() {
getOrCreateTagBuilder(ConventionalBlockTags.CONCRETE)
.add(Blocks.WHITE_CONCRETE)
.add(Blocks.ORANGE_CONCRETE)
.add(Blocks.MAGENTA_CONCRETE)
.add(Blocks.LIGHT_BLUE_CONCRETE)
.add(Blocks.YELLOW_CONCRETE)
.add(Blocks.LIME_CONCRETE)
.add(Blocks.PINK_CONCRETE)
.add(Blocks.GRAY_CONCRETE)
.add(Blocks.LIGHT_GRAY_CONCRETE)
.add(Blocks.CYAN_CONCRETE)
.add(Blocks.PURPLE_CONCRETE)
.add(Blocks.BLUE_CONCRETE)
.add(Blocks.BROWN_CONCRETE)
.add(Blocks.GREEN_CONCRETE)
.add(Blocks.BLACK_CONCRETE)
.add(Blocks.RED_CONCRETE);
}

private void generateDyedTags() {
getOrCreateTagBuilder(ConventionalBlockTags.BLACK_DYED)
.add(Blocks.BLACK_BANNER).add(Blocks.BLACK_BED).add(Blocks.BLACK_CANDLE).add(Blocks.BLACK_CARPET)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, T
translationBuilder.add(ConventionalBlockTags.WOODEN_CHESTS, "Wooden Chests");
translationBuilder.add(ConventionalBlockTags.GLASS_BLOCKS, "Glass Blocks");
translationBuilder.add(ConventionalBlockTags.GLASS_PANES, "Glass Panes");
translationBuilder.add(ConventionalBlockTags.GLAZED_TERRACOTTA, "Glaze Terracotta");
translationBuilder.add(ConventionalBlockTags.SHULKER_BOXES, "Shulker Boxes");
translationBuilder.add(ConventionalBlockTags.CONCRETE, "Concrete");
translationBuilder.add(ConventionalBlockTags.BUDDING_BLOCKS, "Budding Blocks");
translationBuilder.add(ConventionalBlockTags.BUDS, "Buds");
translationBuilder.add(ConventionalBlockTags.CLUSTERS, "Clusters");
Expand Down Expand Up @@ -110,6 +112,16 @@ public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, T
translationBuilder.add(ConventionalItemTags.STONES, "Stones");
translationBuilder.add(ConventionalItemTags.COBBLESTONES, "Cobblestones");
translationBuilder.add(ConventionalItemTags.TOOLS, "Tools");
translationBuilder.add(ConventionalItemTags.SHEAR_TOOLS, "Shears");
translationBuilder.add(ConventionalItemTags.SPEAR_TOOLS, "Spears");
translationBuilder.add(ConventionalItemTags.BOW_TOOLS, "Bows");
translationBuilder.add(ConventionalItemTags.CROSSBOW_TOOLS, "Crossbows");
translationBuilder.add(ConventionalItemTags.SHIELD_TOOLS, "Shields");
translationBuilder.add(ConventionalItemTags.FISHING_ROD_TOOLS, "Fishing Rods");
translationBuilder.add(ConventionalItemTags.BRUSH_TOOLS, "Brushes");
translationBuilder.add(ConventionalItemTags.MELEE_WEAPON_TOOLS, "Melee Weapons");
translationBuilder.add(ConventionalItemTags.RANGED_WEAPON_TOOLS, "Ranged Weapons");
translationBuilder.add(ConventionalItemTags.MINING_TOOL_TOOLS, "Mining Tools");
translationBuilder.add(ConventionalItemTags.SHEARS_TOOLS, "Shears");
translationBuilder.add(ConventionalItemTags.SPEARS_TOOLS, "Spears");
translationBuilder.add(ConventionalItemTags.BOWS_TOOLS, "Bows");
Expand Down Expand Up @@ -182,7 +194,10 @@ public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, T
translationBuilder.add(ConventionalItemTags.WOODEN_CHESTS, "Wooden Chests");
translationBuilder.add(ConventionalItemTags.GLASS_BLOCKS, "Glass Blocks");
translationBuilder.add(ConventionalItemTags.GLASS_PANES, "Glass Panes");
translationBuilder.add(ConventionalItemTags.GLAZED_TERRACOTTA, "Glaze Terracotta");
translationBuilder.add(ConventionalItemTags.SHULKER_BOXES, "Shulker Boxes");
translationBuilder.add(ConventionalItemTags.CONCRETE, "Concrete");
translationBuilder.add(ConventionalItemTags.CONCRETE_POWDER, "Concrete Powder");
translationBuilder.add(ConventionalItemTags.BUDDING_BLOCKS, "Budding Blocks");
translationBuilder.add(ConventionalItemTags.BUDS, "Buds");
translationBuilder.add(ConventionalItemTags.CLUSTERS, "Clusters");
Expand Down Expand Up @@ -250,6 +265,7 @@ public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, T
translationBuilder.add(ConventionalItemTags.PLAYER_WORKSTATIONS_CRAFTING_TABLES, "Crafting Tables");
translationBuilder.add(ConventionalItemTags.PLAYER_WORKSTATIONS_FURNACES, "Furnaces");
translationBuilder.add(ConventionalItemTags.STRINGS, "Strings");
translationBuilder.add(ConventionalItemTags.MUSIC_DISCS, "Music Discs");
translationBuilder.add(ConventionalItemTags.RODS, "Rods");
translationBuilder.add(ConventionalItemTags.WOODEN_RODS, "Wooden Rods");
translationBuilder.add(ConventionalItemTags.BLAZE_RODS, "Blaze Rods");
Expand Down
Loading

0 comments on commit 18dd60f

Please sign in to comment.