Skip to content

Commit

Permalink
item_stack.go: Fix marshaling for anvils and looms
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Aug 20, 2024
1 parent aed4aa4 commit 1c85aa8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions minecraft/protocol/item_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,17 +528,13 @@ 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
}

// Marshal ...
func (c *CraftRecipeOptionalStackRequestAction) Marshal(r IO) {
r.Varuint32(&c.RecipeNetworkID)
r.Uint8(&c.NumberOfCrafts)
r.Int32(&c.FilterStringIndex)
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1c85aa8

Please sign in to comment.