Skip to content

support for crafting #670

Open
Open
@maxomatic458

Description

@maxomatic458

As crafting is a core part of the game, i believe valenece should in some way include support for handling crafting.
Ideally this would be implemented in a way that makes it possible to craft items in any menu (not just the vanilla menus).

Maybe a CraftingRecipe struct could look like this:

struct CraftingRecipe {
    /// Items to be used for crafting (slots in the OpenInventory, item stack)
    cost: HashMap<u16, ItemStack>,
    /// The item(s) that will be crafted (slots in the OpenInventory, item stack)
    result: HashMap<u16, ItemStack>,
    /// If the item(s) should be crafted as soon as all the required items are in the slots (if false, you will have to take one of the result items for the cost items to be used)
    instant_craft: bool,
    // some more stuff
    ...
}

and for furnaces some extra logic (maybe a seperate struct) would be required.

those recipes would be attached to OpenInventories as a component (maybe like a Recipes Component)

Any thoughts on that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions