From 1c85aa8148cabbc8ef90deb843726137d5c29ef6 Mon Sep 17 00:00:00 2001 From: TwistedAsylumMC Date: Tue, 20 Aug 2024 13:57:30 +0100 Subject: [PATCH] item_stack.go: Fix marshaling for anvils and looms --- minecraft/protocol/item_stack.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/minecraft/protocol/item_stack.go b/minecraft/protocol/item_stack.go index 6dd8fbd5..0b18e72a 100644 --- a/minecraft/protocol/item_stack.go +++ b/minecraft/protocol/item_stack.go @@ -528,9 +528,6 @@ type CraftRecipeOptionalStackRequestAction struct { // one of the multi-recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as // of 1.16. RecipeNetworkID uint32 - // NumberOfCrafts is how many times the recipe was crafted. This field appears to be boilerplate and - // has no effect. - NumberOfCrafts byte // FilterStringIndex is the index of a filter string sent in a ItemStackRequest. FilterStringIndex int32 } @@ -538,7 +535,6 @@ type CraftRecipeOptionalStackRequestAction struct { // Marshal ... func (c *CraftRecipeOptionalStackRequestAction) Marshal(r IO) { r.Varuint32(&c.RecipeNetworkID) - r.Uint8(&c.NumberOfCrafts) r.Int32(&c.FilterStringIndex) } @@ -568,11 +564,15 @@ func (c *CraftGrindstoneRecipeStackRequestAction) Marshal(r IO) { type CraftLoomRecipeStackRequestAction struct { // Pattern is the pattern identifier for the loom recipe. Pattern string + // NumberOfCrafts is how many times the recipe was crafted. This field appears to be boilerplate and + // has no effect. + NumberOfCrafts byte } // Marshal ... func (c *CraftLoomRecipeStackRequestAction) Marshal(r IO) { r.String(&c.Pattern) + r.Uint8(&c.NumberOfCrafts) } // CraftNonImplementedStackRequestAction is an action sent for inventory actions that aren't yet implemented