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 recipes to empty teapots (hot or cold) #58

Open
wants to merge 7 commits into
base: 1.20
Choose a base branch
from

Conversation

jshipley
Copy link
Contributor

Added two new items:

  • Cup of Hot Water -> consumable like tea, but doesn't have any benefit
  • Cup of Frothed Milk -> not as filling as hot cocoa, and will remove one status effect like milk (regardless of cocoa configuration)

Also added several new recipes:

  • Crafting unheated water or milk teapot with an empty bucket will transfer the milk/water to the bucket
  • Crafting hot water or frothed milk teapot with teacup will give cup of hot water or cup of frothed milk
  • Tea / cocoa recipes can be crafted with cup of hot water / frothed milk as well as with heated teapots.

Closes #47

Happy Modtober 2024!

.requires(teapot_water)
.requires(Items.BUCKET)
.unlockedBy("has_item", has(teapot_water))
.save(consumer, "water_bucket_from_teapot");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recipes should never go under minecraft. they should be under simplytea. If there is no resource location parameter set the namespace as a string, simplytea:water_bucket_from_teapot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All recipes are going into the simplytea namespace now.

@@ -155,7 +172,7 @@ private static void addTea(Consumer<FinishedRecipe> consumer, ItemLike filledCup
builder.requires(ingredient);
}
builder.unlockedBy("has_bag", has(ingredients[0]));
builder.save(consumer);
builder.save(consumer, filledCup.toString() + "_" + ingredients[ingredients.length-1].toString());
Copy link
Owner

@KnightMiner KnightMiner Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use toString, that is very unreliable and I don't believe it includes the namespace. Get the registry ID, see suffix above. We probably don't need the namespace for the "from" part, just need to make sure the recipes are actually under simplytea. That, or just simply the logic by passing in a String suffix parameter. e.g.:

builder.save(consumer, suffix(filledCup, + "_from_" + suffix).toString())

and pass in "cup" or "teapot" as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using "_from_cup" or "_from_tea" suffix now.


// advanced tea
addTea(consumer, cup_cocoa, Items.COCOA_BEANS, Items.COCOA_BEANS, teapot_frothed);
addTea(consumer, cup_cocoa, Items.COCOA_BEANS, cup_frothed);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this just 1 cocoa beans instead of 2? 1 cup milk + 2 cocoa = 1 cup cocoa.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added second cocoa bean to cocoa from cup recipe.

@@ -29,16 +30,17 @@ public CocoaItem(Properties props) {

@Override
public ItemStack finishUsingItem(ItemStack stack, Level worldIn, LivingEntity living) {
boolean isMilk = stack.is(Registration.cup_frothed);
Copy link
Owner

@KnightMiner KnightMiner Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like having to special case this. Lets instead make the CocoaItem constructor take in a CocoaDrink parameter, then use that field instead of a static reference through config. Will let you pass in the proper drink for each of cocoa and milk

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the CocoaDrink config was already being passed in as FoodProperties, I used that in CocoaItem instead (similar to how it was already used in TeaCupItem).


// advanced tea
addTea(consumer, cup_cocoa, Items.COCOA_BEANS, Items.COCOA_BEANS, teapot_frothed);
addTea(consumer, cup_cocoa, Items.COCOA_BEANS, cup_frothed);
addHoney(consumer, RecipeCategory.FOOD, cup_cocoa, tea_stick, CocoaItem.CINNAMON_TAG);
addTea(consumer, cup_tea_chai, teabag_black, tea_stick, teapot_frothed);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iced tea and chai both are not added using the helper above, so they need their hot water cup recipes here like you did with cocoa.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like iced tea doesn't even need a teapot at all. The recipe is just a cup, teabag, apple, and ice cubes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, that doesn't seem right. I need to remember my reasoning for that. It might just be a bug as I could not use the helper with the tag.

I'll consider whether it should have a pot in the recipe after this PR is finished.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the cup recipe for chai.

Another recipe that you could consider is frothed milk with cinnamon. I wasn't sure whether it made sense or not as hot water and frothed milk are supposed to be much less useful than the actual teas or cocoa, but it would be useful for frothed milk to also have the option to clear all status effects instead of just one.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Frothed milk with cinnamon seems like something someone would drink. So sure, why not.

cup_cocoa = register(r, new CocoaItem(props.food(Config.SERVER.cocoa)), "cup_cocoa");
cup_frothed = register(r, new CocoaItem(props.food(Config.SERVER.cocoa)), "cup_frothed");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be frothed_milk, not cocoa. Also, like I suggested in CocoaItem, lets pass in Config.SERVER.cocoa/Config.SERVER.frothed_milk to the constructor parameter so we have cure effect properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had already caught and changed that. Maybe I didn't push in the change. It's fixed now.

@KnightMiner
Copy link
Owner

KnightMiner commented Oct 16, 2024

Overall a great start. Most of the comments are some namespacing issues with the recipes, and a couple of recipes you missed adding.

Cup of Frothed Milk -> not as filling as hot cocoa, and will remove one status effect like milk (regardless of cocoa configuration).

I left some comments, but it should definitely have its own config, just a different default.

Lets default cocoa to "clear a random positive effect" and default milk to "clear a random effect, positive or negative".

Should also have low food values, since there is no milking delay so milk is a nearly free food source; its the cocoa beans that make hot cocoa restore most of its hunger.

Crafting unheated water or milk teapot with an empty bucket will transfer the milk/water to the bucket

I'm not sure I like this recipe. I think I'd rather just treat the filled pots as "fluid handler items" and support emptying them into tanks, so it be the domain of #46.

You could also let the player just dump out a filled but not hot teapot by right clicking a block with it. No need to place a fluid, but play a nice sound like dumping a bucket (and if you want to be very fancy, throw in some water/milk particles). Should require the player to be sneaking to do so. At that point, sneak+right click could dump a hot teapot too. Note there is a good chance this feature would conflict with #57 as both require adding a class for filled not-hot teapots.

Tea / cocoa recipes can be crafted with cup of hot water / frothed milk as well as with heated teapots.

I like this idea, just make sure all the recipes are the same (you were missing a couple, and cooca had too few beans, I don't want a discount because you used a cup or used a pot).

@jshipley jshipley marked this pull request as draft October 18, 2024 17:49
@jshipley
Copy link
Contributor Author

This will need #57 to completely work, so I'm going to convert it into a draft until that's complete and merged in.

The recipe are cleaned up, frothed milk is set up with a config, and teapots can be dumped. I even added new splash particles for the milk.

@jshipley
Copy link
Contributor Author

jshipley commented Nov 1, 2024

1.20 branch merged in (including #57), and frothed milk with cinnamon recipe added

@jshipley jshipley marked this pull request as ready for review November 1, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Dumping teapots
2 participants