From 79af874e5bfd87185b7ddc3d9b3883da75244b86 Mon Sep 17 00:00:00 2001 From: AkmalFairuz Date: Fri, 10 Jan 2025 19:05:12 +0700 Subject: [PATCH] Translate PlayerAuthInput.ItemStackRequest --- legacyver/legacypacket/player_auth_input.go | 2 +- legacyver/protocol.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/legacyver/legacypacket/player_auth_input.go b/legacyver/legacypacket/player_auth_input.go index a52a4ef..0208c88 100644 --- a/legacyver/legacypacket/player_auth_input.go +++ b/legacyver/legacypacket/player_auth_input.go @@ -46,7 +46,7 @@ type PlayerAuthInput struct { // ItemInteractionData is the transaction data if the InputData includes an item interaction. ItemInteractionData protocol.UseItemTransactionData // ItemStackRequest is sent by the client to change an item in their inventory. - ItemStackRequest protocol.ItemStackRequest + ItemStackRequest proto.ItemStackRequest // BlockActions is a slice of block actions that the client has interacted with. BlockActions []protocol.PlayerBlockAction // VehicleRotation is the rotation of the vehicle that the player is in, if any. diff --git a/legacyver/protocol.go b/legacyver/protocol.go index 105d6de..6901fb7 100644 --- a/legacyver/protocol.go +++ b/legacyver/protocol.go @@ -158,7 +158,7 @@ func (p *Protocol) downgradePackets(pks []packet.Packet, conn *minecraft.Conn) [ Tick: pk.Tick, Delta: pk.Delta, ItemInteractionData: pk.ItemInteractionData, - ItemStackRequest: pk.ItemStackRequest, + ItemStackRequest: (&proto.ItemStackRequest{}).FromLatest(pk.ItemStackRequest), BlockActions: pk.BlockActions, VehicleRotation: pk.VehicleRotation, ClientPredictedVehicle: pk.ClientPredictedVehicle, @@ -436,7 +436,7 @@ func (p *Protocol) upgradePackets(pks []packet.Packet, conn *minecraft.Conn) []p Tick: pk.Tick, Delta: pk.Delta, ItemInteractionData: pk.ItemInteractionData, - ItemStackRequest: pk.ItemStackRequest, + ItemStackRequest: pk.ItemStackRequest.ToLatest(), BlockActions: pk.BlockActions, VehicleRotation: pk.VehicleRotation, ClientPredictedVehicle: pk.ClientPredictedVehicle,