pub struct Container {
pub inventory_type: InventoryType,
pub title: String,
pub backing: ContainerBacking,
pub initial_slots: Option<Vec<Slot>>,
}Expand description
Reusable template value describing how to open a container window.
A Container is a plain data value with no side effects. It can
be stored, cloned, and passed to ctx.containers().open(&container)
to show the window to any player. Build one via
Container::builder() or ContainerBuilder::new().
Fields§
§inventory_type: InventoryTypeThe Minecraft inventory type to open.
title: StringWindow title shown to the player.
backing: ContainerBackingWhether the container is virtual (GUI) or backed by a block.
initial_slots: Option<Vec<Slot>>Optional initial slot contents.
If None and backing is Block, the server reads slots from
the block entity at the position. If None and backing is
Virtual, slots start empty.
If Some, these slots are used as-is (padded/truncated to match
inventory_type.slot_count()).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Container
impl RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnsafeUnpin for Container
impl UnwindSafe for Container
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