Skip to main content

Outgoing

Enum Outgoing 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Click(ClickPacket)

window_click.

§

Confirm

transaction answer to a rejected confirm (always accepted = true, like vanilla).

Fields

§window_id: i8

Window id as received.

§action: i16

Action number as received.

§

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).

Fields

§window_id: i32

Container id.

§button: i32

Button id.

§

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

Source

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

Source

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

Source

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

Source

pub fn to_v1_8(&self) -> Option<ServerboundPlayPacket>

The 1.8 serverbound packet (None for Outgoing::ContainerClick, which only a 26.1 inventory produces).

Source

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).

Source

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).

Trait Implementations§

Source§

impl Clone for Outgoing

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Outgoing

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Outgoing

Source§

impl PartialEq for Outgoing

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Outgoing

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.