pub struct CraftingGrid {
pub slots: [Slot; 9],
pub grid_size: u8,
pub output: Slot,
}Expand description
Tracks the contents of a player’s crafting grid.
Used for both the 2x2 inventory crafting grid and the 3x3 crafting
table grid. The grid_size field determines which slots are active:
for a 2x2 grid, only slots[0..4] are used; for a 3x3 grid, all
nine slots are active.
The output slot holds the result computed by the recipe matching
system. It is read-only from the player’s perspective — the server
sets it when the grid contents change.
Fields§
§slots: [Slot; 9]The 9 crafting input slots. For a 2x2 grid, only indices 0-3 are used; indices 4-8 remain empty.
grid_size: u8Grid dimension: 2 for the player inventory grid, 3 for a crafting table.
output: SlotThe crafting output slot, set by the recipe matching system.
Implementations§
Source§impl CraftingGrid
impl CraftingGrid
Trait Implementations§
Source§impl Clone for CraftingGrid
impl Clone for CraftingGrid
Source§fn clone(&self) -> CraftingGrid
fn clone(&self) -> CraftingGrid
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 CraftingGrid
impl Debug for CraftingGrid
impl Component for CraftingGrid
Auto Trait Implementations§
impl Freeze for CraftingGrid
impl RefUnwindSafe for CraftingGrid
impl Send for CraftingGrid
impl Sync for CraftingGrid
impl Unpin for CraftingGrid
impl UnsafeUnpin for CraftingGrid
impl UnwindSafe for CraftingGrid
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