GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Feture: CraftRecipeRequest · Issue #421 · feather-rs/feather

Feture: CraftRecipeRequest #421

New issue
Copy link
New issue
Copy link
Open
Open
Feture: CraftRecipeRequest#421
Copy link

Description

@Miro-Andrin
Miro-Andrin
opened on May 11, 2021
Issue body actions

Feature Request

Handle the CraftRecipeRequest in feather/server/src/packet_handlers.rs

Description

This packet is sent when a player clicks a recipe in the crafting book that is craftable (white border). 

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.

Activity

  1. Miro-Andrin
    changed the title [-]CraftRecipeRequest[/-] [+]Feture: CraftRecipeRequest[/+] on May 11, 2021
  2. caelunshun commented on May 11, 2021

    @caelunshun
    caelunshun
    on May 11, 2021
    Member
    More actions

    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.

    Reacted by Miro and TypicalDarkness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.