#[non_exhaustive]pub enum Outgoing {
Click(ClickPacket),
Confirm {
window_id: i8,
action: i16,
},
CloseWindow(u8),
OpenInventory,
ContainerClick(ContainerClick),
Creative(Vec<CreativePacket>),
RenameItem(String),
ButtonClick {
window_id: i32,
button: i32,
},
SelectTrade(i32),
Swing,
}Expand description
A packet the inventory wants sent. Write it right away, in call order (before the tick’s movement packet when it comes from a behaviour action).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Click(ClickPacket)
window_click.
Confirm
transaction answer to a rejected confirm (always accepted = true, like vanilla).
CloseWindow(u8)
close_window with this id (0 = player inventory).
OpenInventory
1.8 only: client_command “open inventory achievement” (vanilla sends it when E opens
the inventory).
ContainerClick(ContainerClick)
26.1 container_click (no confirm exists: the server applies every click and resends
the slots whose hashes differ from its own result).
Creative(Vec<CreativePacket>)
26.1 creative inventory screen (window 0 in creative mode): the packets the real
client sends, in order (often none). See CreativePacket.
RenameItem(String)
26.1 rename_item: the anvil’s name field (Inventory::anvil_rename_modern).
ButtonClick
26.1 container_button_click (a loom pattern: Inventory::select_loom_pattern_modern).
SelectTrade(i32)
26.1 select_trade (Inventory::select_trade_modern).
Swing
1.16.5 arm_animation (main hand) outside a click: the client dropped a carried stack
(PlayerEntity.dropItem swings), e.g. when a server window replaced the open screen.
Implementations§
Source§impl Outgoing
impl Outgoing
Sourcepub fn to_v26_1(&self, reg: &HashRegistries) -> Option<ServerboundPlayPacket>
pub fn to_v26_1(&self, reg: &HashRegistries) -> Option<ServerboundPlayPacket>
The 26.1 serverbound packet (None for the legacy-only variants, which a 26.1
inventory never returns, and for Outgoing::Creative, whose packets
CreativePacket::to_v26_1 encodes one by one).
Source§impl Outgoing
impl Outgoing
Sourcepub fn to_v26_2(&self, reg: &HashRegistries) -> Option<ServerboundPlayPacket>
pub fn to_v26_2(&self, reg: &HashRegistries) -> Option<ServerboundPlayPacket>
The 26.2 serverbound packet (None for the legacy-only variants and Creative).
Source§impl Outgoing
impl Outgoing
Sourcepub fn to_v26_3(&self, reg: &HashRegistries) -> Option<ServerboundPlayPacket>
pub fn to_v26_3(&self, reg: &HashRegistries) -> Option<ServerboundPlayPacket>
The 26.3 serverbound packet (None for the legacy-only variants and Creative).
Source§impl Outgoing
impl Outgoing
Sourcepub fn to_v1_8(&self) -> Option<ServerboundPlayPacket>
pub fn to_v1_8(&self) -> Option<ServerboundPlayPacket>
The 1.8 serverbound packet (None for Outgoing::ContainerClick, which only a 26.1
inventory produces).
Sourcepub fn to_v1_12_2(&self) -> Option<ServerboundPlayPacket>
pub fn to_v1_12_2(&self) -> Option<ServerboundPlayPacket>
The 1.12.2 serverbound packet (None for Outgoing::OpenInventory, which 1.12 does
not have; Inventory::open_inventory never returns it on 1.12).
Sourcepub fn to_v1_16_5(&self) -> Option<ServerboundPlayPacket>
pub fn to_v1_16_5(&self) -> Option<ServerboundPlayPacket>
The 1.16.5 serverbound packet (None for Outgoing::OpenInventory, which 1.16.5
does not have; Inventory::open_inventory never returns it on 1.16.5).