You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow advanced recipes to accept items with different NBT #12
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
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.
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"?)
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.
Activity
cpaca commentedon Feb 24, 2023
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.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
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.
cpaca commentedon Feb 24, 2023
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"?)
StrangeOne101 commentedon Feb 24, 2023
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