MCPcopy Create free account
hub / github.com/TyphoonMC/TyphoonCore / Handle

Method Handle

packet_handle.go:578–593  ·  view source on GitHub ↗
(player *Player)

Source from the content-addressed store, hash-verified

576 return
577}
578func (packet *PacketPlayPluginMessage) Handle(player *Player) {
579 if packet.Channel == "MC|Brand" || packet.Channel == "minecraft:brand" {
580 log.Printf("%s is using %s client", player.name, string(packet.Data))
581 buff := make([]byte, len(player.core.brand)+1)
582 length := binary.PutUvarint(buff, uint64(len(player.core.brand)))
583 copy(buff[length:], []byte(player.core.brand))
584 player.WritePacket(&PacketPlayPluginMessage{
585 packet.Channel,
586 buff,
587 })
588 }
589 player.core.CallEvent(&PluginMessageEvent{
590 packet.Channel,
591 packet.Data,
592 })
593}
594func (packet *PacketPlayPluginMessage) Id() (int, Protocol) {
595 return 0x18, V1_10
596}

Callers

nothing calls this directly

Calls 2

WritePacketMethod · 0.80
CallEventMethod · 0.80

Tested by

no test coverage detected