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
To implement handle this packet we need to have a list of every Minecraft recipe. We also want this list to be viewable and editable by plugins. As far as i know feather currently does not have any knowledge of recipes. And implementing this feature would require multiple steps.
a) Add recipes to libcraft
In /libcraft we have definitions on minecraft related data. This is probably were we want to add a definition containing all vanilla recipes. (Ask someone on discord to make sure).
minecraft-data is a awesome project that collects minecraft related data. They keep up to date sources for stuff like recipes. You would have to implement a rust macro that converts the json into rust structs.
This is somewhat difficult for beginners, as macros are tricky.
b) Add recipe handling to quill.
For this step i am not a 100% certain on how it should be implemented. But my idea is that we put recipes into the ECS. Every recipe is just a entity with a recipe component. The file quill/common/src/components.rs has defined a couple of components that might be a starting point for anyone interested in implementing this feature. Another solution is that we manage recopies through host-calls.
Host calls are defined in quill/sys. They're FFI functions that plugins can call to do things on the server. Host calls have to be implemented in feather/plugin-host/src/host_calls.rs. To invoke a function on the plugin, you have to export it with #[no_mangle]. See the macro in quill/api/src/lib.rs for an example for how this works.
The text was updated successfully, but these errors were encountered:
minecraft-data is a awesome project that collects minecraft related data. They keep up to date sources for stuff like recipes. You would have to implement a rust macro that converts the json into rust structs.
Recipes are stored in datapacks, so ideally we'd load them from the vanilla datapack at runtime. feather-datapacks is already a WIP crate in the source tree, so adding recipe support to it should be possible.
But my idea is that we put recipes into the ECS. Every recipe is just a entity with a recipe component.
Not sure I agree with this—the ECS isn't a silver bullet. We'll need to do lookups on the recipe set to efficiently compute crafting results, for example, and this is harder with the ECS than it needs to be. IMO a RecipeRegistry stored in the Game would be better; we can provide access to it through host calls.
Feature Request
Handle the CraftRecipeRequest in feather/server/src/packet_handlers.rs
Description
Wiki
To implement handle this packet we need to have a list of every Minecraft recipe. We also want this list to be viewable and editable by plugins. As far as i know feather currently does not have any knowledge of recipes. And implementing this feature would require multiple steps.
a) Add recipes to libcraft
In /libcraft we have definitions on minecraft related data. This is probably were we want to add a definition containing all vanilla recipes. (Ask someone on discord to make sure).
minecraft-data is a awesome project that collects minecraft related data. They keep up to date sources for stuff like recipes. You would have to implement a rust macro that converts the json into rust structs.
This is somewhat difficult for beginners, as macros are tricky.
b) Add recipe handling to quill.
For this step i am not a 100% certain on how it should be implemented. But my idea is that we put recipes into the ECS. Every recipe is just a entity with a recipe component. The file quill/common/src/components.rs has defined a couple of components that might be a starting point for anyone interested in implementing this feature. Another solution is that we manage recopies through host-calls.
Host calls are defined in quill/sys. They're FFI functions that plugins can call to do things on the server. Host calls have to be implemented in feather/plugin-host/src/host_calls.rs. To invoke a function on the plugin, you have to export it with #[no_mangle]. See the macro in quill/api/src/lib.rs for an example for how this works.
The text was updated successfully, but these errors were encountered: