Skip to main content

Module recipes

Module recipes 

Source
Expand description

Plugin-facing wrapper around the recipe registry that dispatches registry-lifecycle events.

Plugins receive a RecipeRegistrar from PluginRegistrar::recipes inside Plugin::on_enable. Every mutation goes through the wrapper so the 3 lifecycle events fire on the game bus:

The wrapper does not expose the underlying registry’s vanilla data through events: RecipeRegistry::with_vanilla runs before any handler is registered, so retroactively dispatching 1557 events would only spam handlers without serving a use case.

Re-exports§

pub use handle::RecipeRegistryHandle;
pub use id::RecipeId;
pub use types::OwnedShapedRecipe;
pub use types::OwnedShapelessRecipe;
pub use types::Recipe;

Modules§

handle
Long-lived handle to the recipe registry.
id
Stable identifier for crafting recipes.
types
Owned recipe data types for plugin interaction.

Structs§

RecipeRegistrar
Plugin-facing handle to the recipe registry with event dispatch.