forked from Sandertv/gophertunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
position_tracking_db_client_request.go
34 lines (29 loc) · 1.3 KB
/
position_tracking_db_client_request.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package packet
import (
"github.com/Adrian8115/gophertunnel-Amethyst-Protocol/minecraft/protocol"
)
const (
PositionTrackingDBRequestActionQuery = iota
)
// PositionTrackingDBClientRequest is a packet sent by the client to request the position and dimension of a
// 'tracking ID'. These IDs are tracked in a database by the server. In 1.16, this is used for lodestones.
// The client will send this request to find the position a lodestone compass needs to point to. If found, it
// will point to the lodestone. If not, it will start spinning around.
// A PositionTrackingDBServerBroadcast packet should be sent in response to this packet.
type PositionTrackingDBClientRequest struct {
// RequestAction is the action that should be performed upon the receiving of the packet. It is one of the
// constants found above.
RequestAction byte
// TrackingID is a unique ID used to identify the request. The server responds with a
// PositionTrackingDBServerBroadcast packet holding the same ID, so that the client can find out what that
// packet was in response to.
TrackingID int32
}
// ID ...
func (*PositionTrackingDBClientRequest) ID() uint32 {
return IDPositionTrackingDBClientRequest
}
func (pk *PositionTrackingDBClientRequest) Marshal(io protocol.IO) {
io.Uint8(&pk.RequestAction)
io.Varint32(&pk.TrackingID)
}