From 3f8b497055386438f4a28ba9d70ddf413b3df11f Mon Sep 17 00:00:00 2001 From: Tides Date: Fri, 7 Jun 2024 16:53:34 -0400 Subject: [PATCH] Thank you mojang very cool --- Obsidian/Client.cs | 10 +++++----- Obsidian/Net/MinecraftStream.Writing.cs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Obsidian/Client.cs b/Obsidian/Client.cs index d8938c38..de0f0270 100644 --- a/Obsidian/Client.cs +++ b/Obsidian/Client.cs @@ -588,11 +588,11 @@ internal async Task SendInfoAsync() await SendTimeUpdateAsync(); await SendWeatherUpdateAsync(); - //await QueuePacketAsync(new SetContainerContentPacket(0, Player.Inventory.ToList()) - //{ - // StateId = Player.Inventory.StateId++, - // CarriedItem = Player.GetHeldItem(), - //}); + await QueuePacketAsync(new SetContainerContentPacket(0, Player.Inventory.ToList()) + { + StateId = Player.Inventory.StateId++, + CarriedItem = Player.GetHeldItem(), + }); await QueuePacketAsync(new SetEntityMetadataPacket { diff --git a/Obsidian/Net/MinecraftStream.Writing.cs b/Obsidian/Net/MinecraftStream.Writing.cs index 24cbe340..1c6ea68f 100644 --- a/Obsidian/Net/MinecraftStream.Writing.cs +++ b/Obsidian/Net/MinecraftStream.Writing.cs @@ -691,12 +691,12 @@ public void WriteCommandNode(CommandNode value) public void WriteItemStack(ItemStack value) { value ??= new ItemStack(0, 0) { Present = true }; - WriteBoolean(value.Present); - if (value.Present) - { - var item = value.AsItem(); - WriteVarInt(item.Id); + var item = value.AsItem(); + WriteVarInt(item.Id); + + if (item.Id != 0) + { WriteByte((sbyte)value.Count); NbtWriter writer = new(this, true);