Skip to content

Commit

Permalink
partial edcode
Browse files Browse the repository at this point in the history
  • Loading branch information
0123456789-jpg committed Mar 14, 2024
1 parent 5aada5d commit 5deeed5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/core/item/src/edcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ impl<Cx> Encode for ItemStack<'_, Cx>
where
Cx: ItemStackCx,
{
fn encode<B>(&self, buf: B) -> Result<(), std::io::Error>
fn encode<B>(&self, mut buf: B) -> Result<(), std::io::Error>
where
B: rimecraft_edcode::bytes::BufMut,
{
if self.count() == 0 {
false.encode(buf)?;
} else {
true.encode(buf)?;
true.encode(&mut buf)?;
let item = self.item();
item.encode(&mut buf)?;
self.count().encode(buf)?;
if item.settings().max_damage.is_some() || item.settings().sync_nbt {
todo!()
}
}
Ok(())
}
Expand Down

0 comments on commit 5deeed5

Please sign in to comment.