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:
RecipeRegisterEvent(Validate, cancellable) — fires before each insert.RecipeRegisteredEvent(Post) — fires after a successful insert.RecipeUnregisteredEvent(Post) — fires after each removal.
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§
- Recipe
Registrar - Plugin-facing handle to the recipe registry with event dispatch.