Skip to content

Commit

Permalink
Drink Convention Tags (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDeathlyCow authored Feb 20, 2025
1 parent e3f744c commit b6a9297
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/generated/resources/assets/c/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@
"tag.item.c.crops.pumpkin": "Pumpkin Crops",
"tag.item.c.crops.sugar_cane": "Sugar Cane Crops",
"tag.item.c.crops.wheat": "Wheat Crops",
"tag.item.c.drink_containing.bottle": "Drink Containing Bottles",
"tag.item.c.drink_containing.bucket": "Drink Containing Buckets",
"tag.item.c.drinks": "Drinks",
"tag.item.c.drinks.honey": "Honey",
"tag.item.c.drinks.juice": "Juice",
"tag.item.c.drinks.magic": "Magical Drinks",
"tag.item.c.drinks.milk": "Milk",
"tag.item.c.drinks.ominous": "Ominous Drinks",
"tag.item.c.drinks.water": "Water",
"tag.item.c.drinks.watery": "Watery Drinks",
"tag.item.c.dusts": "Dusts",
"tag.item.c.dusts.glowstone": "Glowstone Dusts",
"tag.item.c.dusts.redstone": "Redstone Dusts",
Expand Down
11 changes: 11 additions & 0 deletions src/generated/resources/data/c/tags/item/drinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"#c:drinks/water",
"#c:drinks/watery",
"#c:drinks/milk",
"#c:drinks/honey",
"#c:drinks/magic",
"#c:drinks/ominous",
"#c:drinks/juice"
]
}
5 changes: 5 additions & 0 deletions src/generated/resources/data/c/tags/item/drinks/honey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"minecraft:honey_bottle"
]
}
3 changes: 3 additions & 0 deletions src/generated/resources/data/c/tags/item/drinks/juice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"values": []
}
6 changes: 6 additions & 0 deletions src/generated/resources/data/c/tags/item/drinks/magic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"minecraft:potion",
"#c:drinks/ominous"
]
}
5 changes: 5 additions & 0 deletions src/generated/resources/data/c/tags/item/drinks/milk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"minecraft:milk_bucket"
]
}
5 changes: 5 additions & 0 deletions src/generated/resources/data/c/tags/item/drinks/ominous.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"minecraft:ominous_bottle"
]
}
3 changes: 3 additions & 0 deletions src/generated/resources/data/c/tags/item/drinks/water.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"values": []
}
6 changes: 6 additions & 0 deletions src/generated/resources/data/c/tags/item/drinks/watery.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"minecraft:potion",
"#c:drinks/water"
]
}
48 changes: 48 additions & 0 deletions src/main/java/net/neoforged/neoforge/common/Tags.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,54 @@ public static class Items {
public static final TagKey<Item> CROPS_PUMPKIN = tag("crops/pumpkin");
public static final TagKey<Item> CROPS_SUGAR_CANE = tag("crops/sugar_cane");
public static final TagKey<Item> CROPS_WHEAT = tag("crops/wheat");

/**
* Drinks are defined as (1) consumable items that (2) use the
* {@linkplain net.minecraft.world.item.ItemUseAnimation#DRINK drink item use animation}, (3) can be consumed regardless of the
* player's current hunger.
*
* <p>Drinks may provide nutrition and saturation, but are not required to do so.
*
* <p>More specific types of drinks, such as Water, Milk, or Juice should be placed in a sub-tag, such as
* {@code #c:drinks/water}, {@code #c:drinks/milk}, and {@code #c:drinks/juice}.
*/
public static final TagKey<Item> DRINKS = tag("drinks");
/**
* For consumable drinks that contain only water.
*/
public static final TagKey<Item> DRINKS_WATER = tag("drinks/water");
/**
* For consumable drinks that are generally watery (such as potions).
*/
public static final TagKey<Item> DRINKS_WATERY = tag("drinks/watery");
public static final TagKey<Item> DRINKS_MILK = tag("drinks/milk");
public static final TagKey<Item> DRINKS_HONEY = tag("drinks/honey");
/**
* For consumable drinks that are magic in nature and usually grant at least one
* {@link net.minecraft.world.effect.MobEffect} when consumed.
*/
public static final TagKey<Item> DRINKS_MAGIC = tag("drinks/magic");
/**
* For drinks that always grant the {@linkplain net.minecraft.world.effect.MobEffects#BAD_OMEN Bad Omen} effect.
*/
public static final TagKey<Item> DRINKS_OMINOUS = tag("drinks/ominous");
/**
* Plant based fruit and vegetable juices belong in this tag, for example apple juice and carrot juice.
*
* <p>If tags for specific types of juices are desired, they may go in a sub-tag, using their regular name such as
* {@code #c:drinks/apple_juice}.
*/
public static final TagKey<Item> DRINKS_JUICE = tag("drinks/juice");

/**
* For non-empty bottles that are {@linkplain #DRINKS drinkable}.
*/
public static final TagKey<Item> DRINK_CONTAINING_BOTTLE = tag("drink_containing/bottle");
/**
* For non-empty buckets that are {@linkplain #DRINKS drinkable}.
*/
public static final TagKey<Item> DRINK_CONTAINING_BUCKET = tag("drink_containing/bucket");

public static final TagKey<Item> DUSTS = tag("dusts");
public static final TagKey<Item> DUSTS_REDSTONE = tag("dusts/redstone");
public static final TagKey<Item> DUSTS_GLOWSTONE = tag("dusts/glowstone");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ public void addTags(HolderLookup.Provider lookupProvider) {
tag(Tags.Items.CROPS_PUMPKIN).add(Items.PUMPKIN);
tag(Tags.Items.CROPS_SUGAR_CANE).add(Items.SUGAR_CANE);
tag(Tags.Items.CROPS_WHEAT).add(Items.WHEAT);
tag(Tags.Items.DRINKS).addTags(
Tags.Items.DRINKS_WATER, Tags.Items.DRINKS_WATERY, Tags.Items.DRINKS_MILK,
Tags.Items.DRINKS_HONEY, Tags.Items.DRINKS_MAGIC, Tags.Items.DRINKS_OMINOUS,
Tags.Items.DRINKS_JUICE);
tag(Tags.Items.DRINKS_WATER);
tag(Tags.Items.DRINKS_WATERY).add(Items.POTION).addTags(Tags.Items.DRINKS_WATER);
tag(Tags.Items.DRINKS_MILK).add(Items.MILK_BUCKET);
tag(Tags.Items.DRINKS_HONEY).add(Items.HONEY_BOTTLE);
tag(Tags.Items.DRINKS_MAGIC).add(Items.POTION).addTags(Tags.Items.DRINKS_OMINOUS);
tag(Tags.Items.DRINKS_OMINOUS).add(Items.OMINOUS_BOTTLE);
tag(Tags.Items.DRINKS_JUICE);
addColored(Tags.Items.DYED, "{color}_banner");
addColored(Tags.Items.DYED, "{color}_bed");
addColored(Tags.Items.DYED, "{color}_candle");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ protected void addTranslations() {
add(Tags.Items.CROPS_PUMPKIN, "Pumpkin Crops");
add(Tags.Items.CROPS_SUGAR_CANE, "Sugar Cane Crops");
add(Tags.Items.CROPS_WHEAT, "Wheat Crops");
add(Tags.Items.DRINKS, "Drinks");
add(Tags.Items.DRINKS_WATER, "Water");
add(Tags.Items.DRINKS_WATERY, "Watery Drinks");
add(Tags.Items.DRINKS_MILK, "Milk");
add(Tags.Items.DRINKS_HONEY, "Honey");
add(Tags.Items.DRINKS_MAGIC, "Magical Drinks");
add(Tags.Items.DRINKS_OMINOUS, "Ominous Drinks");
add(Tags.Items.DRINKS_JUICE, "Juice");
add(Tags.Items.DRINK_CONTAINING_BUCKET, "Drink Containing Buckets");
add(Tags.Items.DRINK_CONTAINING_BOTTLE, "Drink Containing Bottles");
add(Tags.Items.DUSTS, "Dusts");
add(Tags.Items.DUSTS_GLOWSTONE, "Glowstone Dusts");
add(Tags.Items.DUSTS_REDSTONE, "Redstone Dusts");
Expand Down

0 comments on commit b6a9297

Please sign in to comment.