pub struct RecipeRegisterEvent {
pub recipe: Recipe,
pub cancelled: bool,
}Expand description
A plugin is about to register a recipe (cancellable).
Fired at the Validate stage on the game bus when a plugin
calls RecipeRegistrar::add_shaped / add_shapeless from inside
Plugin::on_enable. Cancellation aborts the registration —
RecipeRegisteredEvent is not fired and the registry is
left untouched.
Useful for permission gating (“only recipe-admin may register
recipes”) and compatibility checks (“a recipe with this id
already exists, refuse”).
Fires during plugin loading, before any player exists. The
dispatch context (ctx.player()) returns sentinel data — handlers
must rely on the event payload, not the context.
Fields§
§recipe: RecipeThe recipe being registered.
cancelled: boolWhether this event has been cancelled by a Validate handler.
Trait Implementations§
Source§impl Clone for RecipeRegisterEvent
impl Clone for RecipeRegisterEvent
Source§fn clone(&self) -> RecipeRegisterEvent
fn clone(&self) -> RecipeRegisterEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RecipeRegisterEvent
impl Debug for RecipeRegisterEvent
Source§impl Event for RecipeRegisterEvent
impl Event for RecipeRegisterEvent
Source§fn is_cancelled(&self) -> bool
fn is_cancelled(&self) -> bool
Whether this event has been cancelled by a Validate handler.
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Upcasts to
&mut dyn Any for mutable type-erased dispatch.Source§impl EventRouting for RecipeRegisterEvent
impl EventRouting for RecipeRegisterEvent
Auto Trait Implementations§
impl Freeze for RecipeRegisterEvent
impl RefUnwindSafe for RecipeRegisterEvent
impl Send for RecipeRegisterEvent
impl Sync for RecipeRegisterEvent
impl Unpin for RecipeRegisterEvent
impl UnsafeUnpin for RecipeRegisterEvent
impl UnwindSafe for RecipeRegisterEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more