-
Notifications
You must be signed in to change notification settings - Fork 383
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 an item setting for better recipe remainders #1180
Add an item setting for better recipe remainders #1180
Conversation
I guess I'll be the one to ask, where did the textures for the hammers come from? |
from gimp |
This kinda sounds like what would supersede #487 I believe? |
yes but only the recipe remainder part |
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/RecipeRemainderProvider.java
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/RecipeRemainderProvider.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/RecipeRemainderProvider.java
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/RecipeRemainderProvider.java
Outdated
Show resolved
Hide resolved
Allows for brewing recipe remainders (once implemented)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I would change the name for the test hammer image, but that's a minor difference. The only other thing I would look at is what happens when the item breaks, and if someone wants to replace it with a different item(stack) as that allows for more customization for recipes. As well, a way to make it so that there is a simple method for returning the same item might be nice, as it doesn't require implementing a RecipeRemainderProvider
for newer modders and for convenience.
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemSettings.java
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemSettings.java
Show resolved
Hide resolved
f71e01b
to
4cc3dc1
Compare
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemSettings.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemSettings.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemSettings.java
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemSettings.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good.
Little nitpick: @param
javadocs shouldn't start with capitalized letter and end with a comma like @return
javadoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No critical problems as I can see.
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemSettings.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemSettings.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/RecipeRemainderProvider.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/RecipeRemainderProvider.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/RecipeRemainderProvider.java
Outdated
Show resolved
Hide resolved
fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/RecipeRemainderProvider.java
Outdated
Show resolved
Hide resolved
Question: do we need to have custom behavior depending on whether the
I am pretty sure we do, and I believe the arguments could make that more explicit. Maybe we could have an enum for context? Or a public interface RemainderContext {
boolean isCrafting();
boolean isBrewing();
boolean isFuel();
// throws if the context is not crafting
Recipe<?> craftingRecipe();
} Also, do we really need to have It's also not clear if the original (I thought about making this an event originally, but this can be added independently later, here we are just extending MC's recipe remainder system to make it more flexible and I think an event would be out of scope). |
Do we really need the non- |
Why do we need these methods again that can't already be determined using |
Last time I checked brewing and fuels have no recipe type... But tbh I would really prefer an ItemStack extension to |
I can tolerate anything that needs to vary on a) the item stack and b) possibly the context, but if it needs to vary based on the actual recipe it should probably be using a custom recipe type... In general, do we even need this for recipes, or are custom recipe types enough? |
I think custom recipe types are enough for most use cases. If you're using this method, chances are it's because you want the behaviour applied to all recipes of a specific kind (crafting/smoking/etc) involving your item. Otherwise you would just make a custom recipe type to use where needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuffs :>
Is it bad how i actually kind of agree with Technician that having a function in the Item class that extends ItemStack and returns the stack would probably be a lot easier and tidier then doing all that code in creating an item since that's a setting not a function we can override? |
Question: Is this going to get incorporated into 1.18.x ? |
Superseded by #2464. |
Adds a conditional recipe remainder (that returns an ItemStack) to FabricItemSettings
also fixes an issue with duplicate keys in the fabric item api v1 testmod fabric.mod.json
Fixes #50