-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow advanced recipes to accept items with different NBT #12
Comments
If you're reading this and thinking "Oh, I'll just override RecipeChoice myself" - won't work. My source is I've tried. If you try to use any RecipeChoice besides the two provided to you, it'll throw an error. Yes, that code is CraftBukkit, not PaperMC, but I got the exact same error ("Unknown recipe stack instance" + ...) when I tried to do it too. |
That's not to say it isn't possible, it just means you'll have to find another method. I've written my suggestion for how to do it below but if I do bother to write it, it won't be right now. (AKA, I'm leaving notes for either myself or someone else to do it.) ShapedRecipe using MaterialChoice, provide a recipe list with the right holoitems on wiki or discord or whatever. EventListener for CraftItemEvent, check if it's a HoloItem recipe, if it is try to grab the relevant recipe - either using a Recipe Registry or Bukkit.getServer().getRecipe() - and if the places where holoitems are supposed to be don't have holoitems, cancel the event and tell the player something (idk, "check discord" or "check the wiki" or "you need [holoitem name] for this recipe"?) |
This extends ExactChoice, so it won't throw an error. Although it's pretty hacky, and not guaranteed to always work, it seemed to work from my testing |
Such as the advanced recipe for revive kits. The soul item in the recipe will always have different NBT.
A system to register "dummy" recipes has already been implemented. This will match most of the ingredients to the advanced recipe so only the capture group needs to be tested
The text was updated successfully, but these errors were encountered: