[SPIGOT-6272] Allow for custom RecipeChoice predicates Created: 09/Dec/20 Updated: 13/Jan/21 |
|
Status: | Open |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Aria Sangarin | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None |
Version: | CraftBukkit version git-Spigot-a19903d-5b74714 (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT) |
Guidelines Read: | Yes |
Description |
Would be awesome if plugins could implement their own versions of RecipeChoice. I've tried to do this with events, but this created buggy behavior when shift-crafting and was also quite a pain to setup when thinking about compatibility and more. |
Comments |
Comment by Aria Sangarin [ 13/Jan/21 ] |
Okay I've tested this and it seems it's not possible to do anything right now. Is there any chance to get a dangerous API that could potentially allow me to base recipe validation entirely on NBT tags? The current code we have right now (using events) is causing a lot of weird client-side issues and sometimes even server-side duplication, etc. Using the already existing bukkit recipe api is also not optimal as any item that has been slightly modified (renamed, enchanted, etc.) will not fit the ExactChoice requirements. I hope something can be worked out! |
Comment by Aria Sangarin [ 10/Dec/20 ] |
Ahh yeah, so recipes don't have references to an unloaded plugins classes, right? Is there any chance that this could be implemented and marked as Deprecated with a note on why it's dangerous to use?
Edit*: Or is it the case that it's already possible and RecipeChoice is "illegal" because of this? |
Comment by md_5 [ 10/Dec/20 ] |
The main barrier is that the recipe would have to be deleted on plugin unload to prevent leaks |