pub struct ContainerBuilder { /* private fields */ }Expand description
Fluent builder for Container configurations.
The builder has no side effects; call .build() to produce a
Container value that can be stored, cloned, and opened for any
player via ctx.containers().open(&container).
Implementations§
Source§impl ContainerBuilder
impl ContainerBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a builder with sensible defaults (Generic9x3, empty title, Virtual, no slots).
Sourcepub fn inventory_type(self, t: InventoryType) -> Self
pub fn inventory_type(self, t: InventoryType) -> Self
Sets the inventory type for the container window.
Sourcepub fn title(self, title: impl Into<String>) -> Self
pub fn title(self, title: impl Into<String>) -> Self
Sets the window title shown to the player.
Sourcepub fn backed_by(self, x: i32, y: i32, z: i32) -> Self
pub fn backed_by(self, x: i32, y: i32, z: i32) -> Self
Backs the container with a block entity at the given position.
If no initial slots are provided via slots(),
the server reads the slots from the block entity at this position.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContainerBuilder
impl RefUnwindSafe for ContainerBuilder
impl Send for ContainerBuilder
impl Sync for ContainerBuilder
impl Unpin for ContainerBuilder
impl UnsafeUnpin for ContainerBuilder
impl UnwindSafe for ContainerBuilder
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