pub struct CraftingGridChangedEvent {
pub grid: [Option<i32>; 9],
pub grid_size: u8,
}Expand description
The contents of a crafting grid have changed.
Fired at the Post stage on the game bus whenever a player
places, removes, or rearranges an item in any crafting slot. This
is a pure notification — the result of the new grid is computed
separately and surfaced through CraftingRecipeMatchedEvent /
CraftingRecipeClearedEvent.
The crafting player is available via ctx.player().
Fields§
§grid: [Option<i32>; 9]Item IDs in the 9 grid slots (None for empty slots).
For a 2x2 grid, only indices 0-3 are populated.
grid_size: u8Grid dimension: 2 for inventory crafting, 3 for crafting table.
Trait Implementations§
Source§impl Clone for CraftingGridChangedEvent
impl Clone for CraftingGridChangedEvent
Source§fn clone(&self) -> CraftingGridChangedEvent
fn clone(&self) -> CraftingGridChangedEvent
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 CraftingGridChangedEvent
impl Debug for CraftingGridChangedEvent
Source§impl Event for CraftingGridChangedEvent
impl Event for CraftingGridChangedEvent
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.Auto Trait Implementations§
impl Freeze for CraftingGridChangedEvent
impl RefUnwindSafe for CraftingGridChangedEvent
impl Send for CraftingGridChangedEvent
impl Sync for CraftingGridChangedEvent
impl Unpin for CraftingGridChangedEvent
impl UnsafeUnpin for CraftingGridChangedEvent
impl UnwindSafe for CraftingGridChangedEvent
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