Palette support 1

This commit is contained in:
Tnze
2021-12-17 18:45:06 +08:00
parent ee33cedd79
commit 70b0fbf1b7
12 changed files with 2481 additions and 17 deletions

21
server/player.go Normal file
View File

@ -0,0 +1,21 @@
package server
import (
"github.com/Tnze/go-mc/net"
pk "github.com/Tnze/go-mc/net/packet"
)
type Player struct {
*net.Conn
EntityID int32
Gamemode byte
}
// Packet757 is a packet in protocol 757.
// We are using type system to force programmers to update packets.
type Packet757 pk.Packet
// WritePacket to player client. The type of parameter will update per version.
func (p *Player) WritePacket(packet Packet757) error {
return p.Conn.WritePacket(pk.Packet(packet))
}