#[non_exhaustive]pub enum WindowKind {
}Expand description
The vanilla screen handler (container class) the client created for a window.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Chest
Chest-like grid of rows × 9 slots (1.8 minecraft:chest, minecraft:container and
unknown types with slots; 1.16.5 generic_9x1 … generic_9x6).
Generic3x3
Dispenser / dropper (1.16.5 generic_3x3).
Hopper
Hopper (5 slots).
ShulkerBox
1.12 / 1.16.5 shulker box (27 slots that refuse shulker boxes).
Crafting
Crafting table: result slot 0, grid 1..=9.
Furnace
Furnace (also 1.16.5 smoker and blast furnace): input 0, fuel 1, output 2.
BrewingStand
Brewing stand (1.8: 4 slots; 1.12 / 1.16.5: 5 with the blaze powder slot).
Enchanting
Enchanting table (item, lapis).
Anvil
Anvil (2 inputs, result).
Beacon
Beacon (payment slot).
Merchant
Villager trading (2 inputs, result).
Horse
Horse / donkey / llama inventory with slots container slots (saddle, armor, chest).
Grindstone
1.16.5 grindstone.
Lectern
1.16.5 lectern (one book slot, no player inventory).
Loom
1.16.5 loom.
Smithing
1.16.5 smithing table.
Cartography
1.16.5 cartography table.
Stonecutter
1.16.5 stonecutter.
Crafter
26.1 crafter: 9 grid slots, the player inventory, then the result (screen slot 45).
Implementations§
Source§impl WindowKind
impl WindowKind
Sourcepub fn from_v1_8(inventory_type: &str, slot_count: u8) -> Option<WindowKind>
pub fn from_v1_8(inventory_type: &str, slot_count: u8) -> Option<WindowKind>
The window type of a 1.8 open_window (inventoryType, slotCount), as
ClientPlayNetworkHandler.onOpenScreen builds it. None: the vanilla client opens no
container for it (a slotless type it has no GUI for).
Sourcepub fn from_v1_12_2(inventory_type: &str, slot_count: u8) -> Option<WindowKind>
pub fn from_v1_12_2(inventory_type: &str, slot_count: u8) -> Option<WindowKind>
The window type of a 1.12.2 open_window (inventoryType, slotCount): the 1.8 rules
plus minecraft:shulker_box.
Sourcepub fn from_v1_16_5(menu_type: i32) -> Option<WindowKind>
pub fn from_v1_16_5(menu_type: i32) -> Option<WindowKind>
The window type of a 1.16.5 open_window (menu type registry id).
Sourcepub fn container_len(self, version: Version) -> usize
pub fn container_len(self, version: Version) -> usize
Number of container slots (before the player’s 27 + 9).
Sourcepub fn has_player_inventory(self) -> bool
pub fn has_player_inventory(self) -> bool
Whether the player’s main inventory and hotbar follow the container slots.