As someone who often plays Minecraft with mods like NEI, I figured a recipe plugin would be useful.
The interface is entirely chat based and very rough around the edges, but it works for most crafting recipes.
To use, simply use /recipes, /recipesfor, or /howdoimake with the id of the item you wish to craft. In addition, you can click the item names in the output to get their recipes without typing.
The lack of an implementation for the Recipe API means that I had to use hacky reflection to access the vanilla classes, but it should use the official recipe API as soon as it’s implemented.
I plan on improving the user interface in the future as well as add support for smelting, potions, etc. recipes as well. Let me know what you think and if I should continue working on this. Thank you.
It looks great, but could you perhaps shorten the “=========” down a bit? It takes up an awful big part of the screen. Or perhaps make that configurable in some way?
That’s default behaviour for the pagination service, looking at the current API, all that be changed is the character used without getting rid of pagination entirely. Granted it’s not working the way I wanted with 1 recipe per page so I might do just that anyway.
You should use MCP directly for accessing internal Minecraft classes, using reflection will not make you proof against updates nor really provide any other benefit except code that is extremely hard to maintain, read, and update. For example using MCP directly would do all the obfuscation work for you that you do manually currently.
I was having trouble linking with MCP. If you can point to some way to link with both Sponge and MCP at the same time, that would be nice. The reflection is just a fallback that will likely be removed when Sponge implements the recipe api.
You need (and should) use an access transformer for accessing private fields. If you can join #spongedev on our IRC for a moment I can help you to set them up.