Skip to content

Commit

Permalink
minecraft/protocol: handle new UseItemTransactionData fields in `Pl…
Browse files Browse the repository at this point in the history
…ayerInventoryAction` (#261)
  • Loading branch information
cooldogedev authored Aug 14, 2024
1 parent 324cf6e commit 91f4c18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions minecraft/protocol/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,15 @@ func (r *Reader) PlayerInventoryAction(x *UseItemTransactionData) {
}
Slice(r, &x.Actions)
r.Varuint32(&x.ActionType)
r.Varuint32(&x.TriggerType)
r.BlockPos(&x.BlockPosition)
r.Varint32(&x.BlockFace)
r.Varint32(&x.HotBarSlot)
r.ItemInstance(&x.HeldItem)
r.Vec3(&x.Position)
r.Vec3(&x.ClickedPosition)
r.Varuint32(&x.BlockRuntimeID)
r.Varuint32(&x.ClientPrediction)
}

// GameRule reads a GameRule x from the Reader.
Expand Down
2 changes: 2 additions & 0 deletions minecraft/protocol/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,15 @@ func (w *Writer) PlayerInventoryAction(x *UseItemTransactionData) {
}
Slice(w, &x.Actions)
w.Varuint32(&x.ActionType)
w.Varuint32(&x.TriggerType)
w.BlockPos(&x.BlockPosition)
w.Varint32(&x.BlockFace)
w.Varint32(&x.HotBarSlot)
w.ItemInstance(&x.HeldItem)
w.Vec3(&x.Position)
w.Vec3(&x.ClickedPosition)
w.Varuint32(&x.BlockRuntimeID)
w.Varuint32(&x.ClientPrediction)
}

// GameRule writes a GameRule x to the Writer.
Expand Down

0 comments on commit 91f4c18

Please sign in to comment.