-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expose potion mixing API #12910
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
base: main
Are you sure you want to change the base?
Expose potion mixing API #12910
Conversation
lynxplay
left a comment
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.
Generally a fan of the concept!
Some minor formatting and logic issues.
paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
Outdated
Show resolved
Hide resolved
paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
Outdated
Show resolved
Hide resolved
|
Seems you got tricked by parchment wrong param names for hasMix (mix doesn't do better really), potion is the ingredient and ingredient is the potion. |
|
Looks like you're right. I kind of assumed potionItem referred to the same thing in either method. Thanks |
notTamion
left a comment
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.
I don't really like how mixPotion returns the original itemstack when there is no mix available. I think we should either make this very clear in the jdocs or imo even better return null if the nms method returns the original itemstack
What if someone adds a noop potion mix? There's no way to differentiate between the two without also checking if the potion mix exists in the first place |
it will still return a copy of the result, not the exact original so a simple reference check should do (at least if i remember correctly from earlier, on my phone rn so can't double check) |
Adds
mixPotionandcanMixPotionmethods to simulate what a brewing stand would do.I think it's a fair change since there's really not much potion API currently.