plugin

package
v0.22.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrandChannelLegacy      string = "MC|Brand"
	BrandChannel            string = "minecraft:brand"
	RegisterChannelLegacy   string = "REGISTER"
	RegisterChannel         string = "minecraft:register"
	UnregisterChannelLegacy string = "UNREGISTER"
	UnregisterChannel       string = "minecraft:unregister"
)

Variables

View Source
var InvalidIdentifierRegex = regexp.MustCompile(`[^a-z0-9\\-_]*`)

Functions

func Channels

func Channels(p *Message) (channels []string)

Channels fetches all the channels in a register or unregister plugin message.

func IsRegister added in v0.15.0

func IsRegister(p *Message) bool

IsRegister determines whether this plugin message is being used to register plugin channels.

func IsUnregister added in v0.15.0

func IsUnregister(p *Message) bool

IsUnregister determines whether this plugin message is being used to unregister plugin channels.

func LegacyRegister

func LegacyRegister(p *Message) bool

LegacyRegister determines whether this plugin message is a legacy (<1.13) registration plugin message.

func LegacyUnregister

func LegacyUnregister(p *Message) bool

LegacyUnregister determines whether this plugin message is a legacy (<1.13) un-registration plugin message.

func McBrand

func McBrand(p *Message) bool

McBrand determines whether this is a brand plugin message. This is shown on the client.

func TransformLegacyToModernChannel

func TransformLegacyToModernChannel(name string) string

TransformLegacyToModernChannel transforms a plugin message channel from a "legacy" (<1.13) form to a modern one.

Types

type Message

type Message struct {
	Channel string
	Data    []byte
}

Message is a Minecraft plugin message packet.

func ConstructChannelsPacket

func ConstructChannelsPacket(protocol proto.Protocol, channels ...string) *Message

ConstructChannelsPacket constructs a channel (un)register packet. channels must not be empty! Note that the Message's Retained field remains nil.

func RewriteMinecraftBrand

func RewriteMinecraftBrand(message *Message, protocol proto.Protocol) *Message

RewriteMinecraftBrand rewrites the brand message to indicate the presence of the proxy.

func (*Message) Decode

func (p *Message) Decode(c *proto.PacketContext, r io.Reader) (err error)

func (*Message) Encode

func (p *Message) Encode(c *proto.PacketContext, wr io.Writer) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL