Add 1.21.2 & 1.21.0 support
This commit is contained in:
29
legacyver/legacypacket/editor_network.go
Normal file
29
legacyver/legacypacket/editor_network.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package legacypacket
|
||||
|
||||
import (
|
||||
"github.com/akmalfairuz/legacy-version/legacyver/proto"
|
||||
"github.com/sandertv/gophertunnel/minecraft/nbt"
|
||||
"github.com/sandertv/gophertunnel/minecraft/protocol"
|
||||
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
|
||||
)
|
||||
|
||||
// EditorNetwork is a packet sent from the server to the client and vise-versa to communicate editor-mode related
|
||||
// information. It carries a single compound tag containing the relevant information.
|
||||
type EditorNetwork struct {
|
||||
// RouteToManager ...
|
||||
RouteToManager bool
|
||||
// Payload is a network little endian compound tag holding data relevant to the editor.
|
||||
Payload map[string]any
|
||||
}
|
||||
|
||||
// ID ...
|
||||
func (*EditorNetwork) ID() uint32 {
|
||||
return packet.IDEditorNetwork
|
||||
}
|
||||
|
||||
func (pk *EditorNetwork) Marshal(io protocol.IO) {
|
||||
if proto.IsProtoGTE(io, proto.ID712) {
|
||||
io.Bool(&pk.RouteToManager)
|
||||
}
|
||||
io.NBT(&pk.Payload, nbt.NetworkLittleEndian)
|
||||
}
|
||||
Reference in New Issue
Block a user