refactor package
This commit is contained in:
19
pkg/protocol/packet/configuration/server/packet.go
Normal file
19
pkg/protocol/packet/configuration/server/packet.go
Normal file
@ -0,0 +1,19 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/data/packetid"
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
)
|
||||
|
||||
type ServerboundPacket interface {
|
||||
pk.Field
|
||||
PacketID() packetid.ServerboundPacketID
|
||||
}
|
||||
|
||||
type serverPacketCreator func() ServerboundPacket
|
||||
|
||||
var packetRegistry = make(map[packetid.ServerboundPacketID]serverPacketCreator)
|
||||
|
||||
func registerPacket(id packetid.ServerboundPacketID, creator serverPacketCreator) {
|
||||
packetRegistry[id] = creator
|
||||
}
|
Reference in New Issue
Block a user