Skip to content

Commit

Permalink
Fix encoding ItemStack in TrackedData (valence-rs#541)
Browse files Browse the repository at this point in the history
When encoding `ItemStack`s in `TrackedData` the `ItemStack` itself is
not optional as it was previously implemented. For further context, when
encoding an `ItemStack` it will only encode as one byte if the
`ItemStack` is empty.

# Objective

- Fixes valence-rs#537 

# Solution

- Remove the optional wrapping around the `ItemStack` value when
encoding it in the `TrackedData`.
  • Loading branch information
guac42 authored Oct 4, 2023
1 parent 5333611 commit a46764c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion crates/valence_entity/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ impl Value {
match self {
Value::Integer(_) => quote!(VarInt(#self_lvalue)),
Value::OptionalInt(_) => quote!(OptionalInt(#self_lvalue)),
Value::ItemStack(_) => quote!(Some(&#self_lvalue)),
_ => quote!(&#self_lvalue),
}
}
Expand Down

0 comments on commit a46764c

Please sign in to comment.