mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 03:10:54 -04:00
Deprecate some conventional tool tags added to vanilla (#2928)
* Deprecate some conventional tool tags added to vanilla For backwards compatibility, the old tag IDs are added to the vanilla ones. The exposed keys are redirected to their replacements. Also optionally adds Cherry Grove biome to `c:in_overworld`. * Keep the convention tags, just deprecated * You saw nothing
This commit is contained in:
parent
1ee8be400a
commit
6baaf9719b
9 changed files with 110 additions and 25 deletions
fabric-convention-tags-v1/src
datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators
generated/resources/data
c/tags/worldgen/biome
minecraft/tags/items
main/java/net/fabricmc/fabric/api/tag/convention/v1
|
@ -81,7 +81,8 @@ public class BiomeTagGenerator extends FabricTagProvider<Biome> {
|
|||
.add(BiomeKeys.SNOWY_SLOPES).add(BiomeKeys.FROZEN_PEAKS).add(BiomeKeys.JAGGED_PEAKS)
|
||||
.add(BiomeKeys.STONY_PEAKS).add(BiomeKeys.MUSHROOM_FIELDS).add(BiomeKeys.DRIPSTONE_CAVES)
|
||||
.add(BiomeKeys.LUSH_CAVES).add(BiomeKeys.SNOWY_BEACH).add(BiomeKeys.SWAMP).add(BiomeKeys.STONY_SHORE)
|
||||
.add(BiomeKeys.DEEP_DARK).add(BiomeKeys.MANGROVE_SWAMP);
|
||||
.add(BiomeKeys.DEEP_DARK).add(BiomeKeys.MANGROVE_SWAMP)
|
||||
.addOptional(BiomeKeys.CHERRY_GROVE);
|
||||
}
|
||||
|
||||
private void generateCategoryTags() {
|
||||
|
|
|
@ -29,34 +29,22 @@ import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
|||
import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags;
|
||||
|
||||
public class ItemTagGenerator extends FabricTagProvider.ItemTagProvider {
|
||||
/**
|
||||
* @deprecated Use {@link ConventionalItemTags#PICKAXES}
|
||||
*/
|
||||
/** @deprecated Replaced with {@link ItemTags#PICKAXES}. */
|
||||
@Deprecated
|
||||
private static final Identifier FABRIC_PICKAXES = createFabricId("pickaxes");
|
||||
/**
|
||||
* @deprecated Use {@link ConventionalItemTags#SHOVELS}
|
||||
*/
|
||||
/** @deprecated Replaced with {@link ItemTags#SHOVELS}. */
|
||||
@Deprecated
|
||||
private static final Identifier FABRIC_SHOVELS = createFabricId("shovels");
|
||||
/**
|
||||
* @deprecated Use {@link ConventionalItemTags#HOES}
|
||||
*/
|
||||
/** @deprecated Replaced with {@link ItemTags#HOES}. */
|
||||
@Deprecated
|
||||
private static final Identifier FABRIC_HOES = createFabricId("hoes");
|
||||
/**
|
||||
* @deprecated Use {@link ConventionalItemTags#AXES}
|
||||
*/
|
||||
/** @deprecated Replaced with {@link ItemTags#AXES}. */
|
||||
@Deprecated
|
||||
private static final Identifier FABRIC_AXES = createFabricId("axes");
|
||||
/**
|
||||
* @deprecated Use {@link ConventionalItemTags#SHEARS}
|
||||
*/
|
||||
/** @deprecated Replaced with {@link ConventionalItemTags#SHEARS}. */
|
||||
@Deprecated
|
||||
private static final Identifier FABRIC_SHEARS = createFabricId("shears");
|
||||
/**
|
||||
* @deprecated Use {@link ConventionalItemTags#SWORDS}
|
||||
*/
|
||||
/** @deprecated Replaced with {@link ItemTags#SWORDS}. */
|
||||
@Deprecated
|
||||
private static final Identifier FABRIC_SWORDS = createFabricId("swords");
|
||||
|
||||
|
@ -305,6 +293,21 @@ public class ItemTagGenerator extends FabricTagProvider.ItemTagProvider {
|
|||
.add(Items.STONE_SHOVEL)
|
||||
.add(Items.IRON_SHOVEL)
|
||||
.add(Items.NETHERITE_SHOVEL);
|
||||
getOrCreateTagBuilder(ItemTags.AXES)
|
||||
.addOptionalTag(ConventionalItemTags.AXES)
|
||||
.addOptionalTag(FABRIC_AXES);
|
||||
getOrCreateTagBuilder(ItemTags.PICKAXES)
|
||||
.addOptionalTag(ConventionalItemTags.PICKAXES)
|
||||
.addOptionalTag(FABRIC_PICKAXES);
|
||||
getOrCreateTagBuilder(ItemTags.HOES)
|
||||
.addOptionalTag(ConventionalItemTags.HOES)
|
||||
.addOptionalTag(FABRIC_HOES);
|
||||
getOrCreateTagBuilder(ItemTags.SWORDS)
|
||||
.addOptionalTag(ConventionalItemTags.SWORDS)
|
||||
.addOptionalTag(FABRIC_SWORDS);
|
||||
getOrCreateTagBuilder(ItemTags.SHOVELS)
|
||||
.addOptionalTag(ConventionalItemTags.SHOVELS)
|
||||
.addOptionalTag(FABRIC_SHOVELS);
|
||||
getOrCreateTagBuilder(ConventionalItemTags.SHEARS)
|
||||
.addOptionalTag(FABRIC_SHEARS)
|
||||
.add(Items.SHEARS);
|
||||
|
|
|
@ -56,6 +56,10 @@
|
|||
"minecraft:swamp",
|
||||
"minecraft:stony_shore",
|
||||
"minecraft:deep_dark",
|
||||
"minecraft:mangrove_swamp"
|
||||
"minecraft:mangrove_swamp",
|
||||
{
|
||||
"id": "minecraft:cherry_grove",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
{
|
||||
"id": "#c:axes",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "#fabric:axes",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
{
|
||||
"id": "#c:hoes",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "#fabric:hoes",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
{
|
||||
"id": "#c:pickaxes",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "#fabric:pickaxes",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
{
|
||||
"id": "#c:shovels",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "#fabric:shovels",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
{
|
||||
"id": "#c:swords",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"id": "#fabric:swords",
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
|
@ -17,6 +17,7 @@
|
|||
package net.fabricmc.fabric.api.tag.convention.v1;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.tag.ItemTags;
|
||||
import net.minecraft.registry.tag.TagKey;
|
||||
|
||||
import net.fabricmc.fabric.impl.tag.convention.TagRegistration;
|
||||
|
@ -30,16 +31,11 @@ public final class ConventionalItemTags {
|
|||
}
|
||||
|
||||
// Tool tags
|
||||
public static final TagKey<Item> PICKAXES = register("pickaxes");
|
||||
public static final TagKey<Item> SHOVELS = register("shovels");
|
||||
public static final TagKey<Item> HOES = register("hoes");
|
||||
public static final TagKey<Item> AXES = register("axes");
|
||||
public static final TagKey<Item> SHEARS = register("shears");
|
||||
/**
|
||||
* For throwable weapons, like Minecraft tridents.
|
||||
*/
|
||||
public static final TagKey<Item> SPEARS = register("spears");
|
||||
public static final TagKey<Item> SWORDS = register("swords");
|
||||
public static final TagKey<Item> BOWS = register("bows");
|
||||
public static final TagKey<Item> SHIELDS = register("shields");
|
||||
// Ores and ingots
|
||||
|
@ -108,6 +104,22 @@ public final class ConventionalItemTags {
|
|||
@Deprecated(forRemoval = true)
|
||||
public static final TagKey<Item> EMPTY_BUCKET = EMPTY_BUCKETS;
|
||||
|
||||
/** @deprecated Replaced with {@link ItemTags#PICKAXES}. */
|
||||
@Deprecated(forRemoval = true)
|
||||
public static final TagKey<Item> PICKAXES = register("pickaxes");
|
||||
/** @deprecated Replaced with {@link ItemTags#SHOVELS}. */
|
||||
@Deprecated(forRemoval = true)
|
||||
public static final TagKey<Item> SHOVELS = register("shovels");
|
||||
/** @deprecated Replaced with {@link ItemTags#HOES}. */
|
||||
@Deprecated(forRemoval = true)
|
||||
public static final TagKey<Item> HOES = register("hoes");
|
||||
/** @deprecated Replaced with {@link ItemTags#AXES}. */
|
||||
@Deprecated(forRemoval = true)
|
||||
public static final TagKey<Item> AXES = register("axes");
|
||||
/** @deprecated Replaced with {@link ItemTags#SWORDS}. */
|
||||
@Deprecated(forRemoval = true)
|
||||
public static final TagKey<Item> SWORDS = register("swords");
|
||||
|
||||
private static TagKey<Item> register(String tagID) {
|
||||
return TagRegistration.ITEM_TAG_REGISTRATION.registerCommon(tagID);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue