Documentation ¶
Index ¶
- Constants
- Variables
- func IsCompatible(proto Protocol) bool
- func JsonEscape(s string) string
- func JsonMessage(s string) json.RawMessage
- func PacketTypeHash(state State, id int) int64
- type BlockPalette
- type BlockRegistry
- type BossBarAction
- type BossBarColor
- type BossBarDivision
- type BufferConfig
- type ChatAction
- type ChatColor
- type ChatComponent
- func (component *ChatComponent) AddExtra(extra IChatComponent)
- func (component *ChatComponent) JSON() (string, error)
- func (component *ChatComponent) SetBold(bold bool)
- func (component *ChatComponent) SetClickEvent(action *ChatAction)
- func (component *ChatComponent) SetColor(color *ChatColor)
- func (component *ChatComponent) SetExtra(extra []IChatComponent)
- func (component *ChatComponent) SetHoverEvent(action *ChatAction)
- func (component *ChatComponent) SetInsertion(insertion string)
- func (component *ChatComponent) SetItalic(italic bool)
- func (component *ChatComponent) SetObfuscated(obfuscated bool)
- func (component *ChatComponent) SetStrikeThrough(strikeThrough bool)
- func (component *ChatComponent) SetUnderlined(underlined bool)
- type ChatPosition
- type ChatStyle
- type Chunk
- type ChunkBlockPalette
- type ChunkSection
- type ClientStatusAction
- type CommandNode
- type CommandNodeType
- type CommandParser
- type CommandParserBool
- func (c *CommandParserBool) Complete(arg string) []string
- func (c *CommandParserBool) GetId() string
- func (c *CommandParserBool) GetSuggestion() CommandSuggestionType
- func (c *CommandParserBool) IsArrayValid(arg []string) bool
- func (c *CommandParserBool) IsMultiple() bool
- func (c *CommandParserBool) IsValid(arg string) bool
- type CommandParserDouble
- func (c *CommandParserDouble) Complete(arg string) []string
- func (c *CommandParserDouble) GetId() string
- func (c *CommandParserDouble) GetSuggestion() CommandSuggestionType
- func (c *CommandParserDouble) IsArrayValid(arg []string) bool
- func (c *CommandParserDouble) IsMultiple() bool
- func (c *CommandParserDouble) IsValid(arg string) bool
- type CommandParserFloat
- func (c *CommandParserFloat) Complete(arg string) []string
- func (c *CommandParserFloat) GetId() string
- func (c *CommandParserFloat) GetSuggestion() CommandSuggestionType
- func (c *CommandParserFloat) IsArrayValid(arg []string) bool
- func (c *CommandParserFloat) IsMultiple() bool
- func (c *CommandParserFloat) IsValid(arg string) bool
- type CommandParserInteger
- func (c *CommandParserInteger) Complete(arg string) []string
- func (c *CommandParserInteger) GetId() string
- func (c *CommandParserInteger) GetSuggestion() CommandSuggestionType
- func (c *CommandParserInteger) IsArrayValid(arg []string) bool
- func (c *CommandParserInteger) IsMultiple() bool
- func (c *CommandParserInteger) IsValid(arg string) bool
- type CommandParserString
- func (c *CommandParserString) Complete(arg string) []string
- func (c *CommandParserString) GetId() string
- func (c *CommandParserString) GetSuggestion() CommandSuggestionType
- func (c *CommandParserString) IsArrayValid(arg []string) bool
- func (c *CommandParserString) IsMultiple() bool
- func (c *CommandParserString) IsValid(arg string) bool
- type CommandParserStringFormat
- type CommandSuggestionType
- type Config
- type ConnReadWrite
- type Core
- func (c *Core) CallEvent(event Event)
- func (c *Core) DeclareCommand(graph *CommandNode)
- func (c *Core) GetConfig(config interface{})
- func (c *Core) GetPlayerRegistry() *PlayerRegistry
- func (c *Core) On(handler interface{})
- func (c *Core) OnPluginMessage(channel string, handler interface{})
- func (c *Core) SetBrand(brand string)
- func (c *Core) SetGamemode(gamemode Gamemode)
- func (c *Core) SetMap(world *Map)
- func (c *Core) Start()
- type Difficulty
- type Dimension
- type Event
- type EventCallback
- type Gamemode
- type HackContent
- type HackMap
- type HackModule
- type HackType
- type IChatComponent
- type InAddr
- type LevelType
- type Location
- type Map
- type OptDouble
- type OptFloat
- type OptInteger
- type Packet
- type PacketBossBar
- type PacketHandshake
- type PacketLoginDisconnect
- type PacketLoginStart
- type PacketLoginSuccess
- type PacketPlayChat
- type PacketPlayChunkData
- func (packet *PacketPlayChunkData) Handle(player *Player)
- func (packet *PacketPlayChunkData) Id() (int, Protocol)
- func (packet *PacketPlayChunkData) Read(player *Player, length int) (err error)
- func (packet *PacketPlayChunkData) Write(player *Player) (err error)
- func (packet *PacketPlayChunkData) WriteV1_13(player *Player) (err error)
- func (packet *PacketPlayChunkData) WriteV1_7(player *Player) (err error)
- func (packet *PacketPlayChunkData) WriteV1_8(player *Player) (err error)
- func (packet *PacketPlayChunkData) WriteV1_9(player *Player) (err error)
- type PacketPlayClientStatus
- type PacketPlayDisconnect
- type PacketPlayJoinGame
- type PacketPlayKeepAlive
- type PacketPlayMessage
- type PacketPlayParticle
- type PacketPlayPlayerAbilities
- type PacketPlayServerDifficulty
- type PacketPlaySpawnPosition
- type PacketPlayTabComplete
- type PacketPlayTabCompleteServerbound
- func (packet *PacketPlayTabCompleteServerbound) Handle(player *Player)
- func (packet *PacketPlayTabCompleteServerbound) Id() (int, Protocol)
- func (packet *PacketPlayTabCompleteServerbound) Read(player *Player, length int) (err error)
- func (packet *PacketPlayTabCompleteServerbound) Write(player *Player) (err error)
- type PacketPlayerListHeaderFooter
- type PacketPlayerPositionLook
- type PacketSetCompression
- type PacketStatusPing
- type PacketStatusRequest
- type PacketStatusResponse
- type PacketUpdateHealth
- type Player
- func (player *Player) GetName() string
- func (player *Player) GetUUID() uuid2.UUID
- func (player *Player) HackClientbound(id int, protocol Protocol) int
- func (player *Player) HackServerbound(id int) int
- func (player *Player) HandlePacket(id int, length int) (packet Packet, err error)
- func (player *Player) Kick(s string)
- func (player *Player) ReadBool() (b bool, err error)
- func (player *Player) ReadByte() (b byte, err error)
- func (player *Player) ReadByteArray(length int) (data []byte, err error)
- func (player *Player) ReadFloat32() (i float32, err error)
- func (player *Player) ReadFloat64() (i float64, err error)
- func (player *Player) ReadNStringLimited(max int) (s string, read int, err error)
- func (player *Player) ReadPacket() (packet Packet, err error)
- func (player *Player) ReadPacketWithCompression() (packet Packet, err error)
- func (player *Player) ReadPacketWithoutCompression() (packet Packet, err error)
- func (player *Player) ReadPosition() (i Position, err error)
- func (player *Player) ReadString() (s string, err error)
- func (player *Player) ReadStringLimited(max int) (s string, err error)
- func (player *Player) ReadUInt16() (i uint16, err error)
- func (player *Player) ReadUInt32() (i uint32, err error)
- func (player *Player) ReadUInt64() (i uint64, err error)
- func (player *Player) ReadUInt8() (i uint8, err error)
- func (player *Player) ReadVarInt() (i int, err error)
- func (p *Player) SendActionBar(message IChatComponent)
- func (p *Player) SendBukkitMessage(message string)
- func (p *Player) SendMessage(message IChatComponent)
- func (p *Player) SendRawActionBar(message string)
- func (p *Player) SendRawMessage(message string)
- func (player *Player) WriteBool(b bool) (err error)
- func (player *Player) WriteByteArray(data []byte) (err error)
- func (player *Player) WriteFloat32(i float32) (err error)
- func (player *Player) WriteFloat64(i float64) (err error)
- func (player *Player) WriteLittleEndianUInt16(i uint16) (err error)
- func (player *Player) WriteNBTCompound(tag nbt.Compound) (err error)
- func (player *Player) WritePacket(packet Packet) (err error)
- func (player *Player) WritePacketWithCompression(packet Packet) (err error)
- func (player *Player) WritePacketWithoutCompression(packet Packet) (err error)
- func (player *Player) WritePosition(i Position) (err error)
- func (player *Player) WriteString(s string) (err error)
- func (player *Player) WriteStringRestricted(s string, max int) (err error)
- func (player *Player) WriteUInt16(i uint16) (err error)
- func (player *Player) WriteUInt32(i uint32) (err error)
- func (player *Player) WriteUInt64(i uint64) (err error)
- func (player *Player) WriteUInt8(i uint8) (err error)
- func (player *Player) WriteUUID(uid uuid.UUID) (err error)
- func (player *Player) WriteVarInt(i int) (err error)
- type PlayerChatEvent
- type PlayerClickType
- type PlayerInteractEvent
- type PlayerJoinEvent
- type PlayerKickEvent
- type PlayerPreJoinEvent
- type PlayerQuitEvent
- type PlayerRegistry
- type PluginMessageEvent
- type Position
- type Protocol
- type ScoreboardPosition
- type State
- type StringChatComponent
- type VarBuffer
Constants ¶
View Source
const ( CommandNodeTypeLiteral CommandNodeTypeArgument )
Variables ¶
View Source
var ( ChatColorBlack = ChatColor{0, "black"} ChatColorDarkBlue = ChatColor{1, "dark_blue"} ChatColorDarkGreen = ChatColor{2, "dark_green"} ChatColorDarkAqua = ChatColor{3, "dark_aqua"} ChatColorDarkRed = ChatColor{4, "dark_red"} ChatColorDarkPurple = ChatColor{5, "dark_purple"} ChatColorGold = ChatColor{6, "gold"} ChatColorGray = ChatColor{7, "gray"} ChatColorDarkGray = ChatColor{8, "dark_gray"} ChatColorIndigo = ChatColor{9, "blue"} ChatColorGreen = ChatColor{10, "green"} ChatColorAqua = ChatColor{11, "aqua"} ChatColorRed = ChatColor{12, "red"} ChatColorPink = ChatColor{13, "light_purple"} ChatColorYellow = ChatColor{14, "yellow"} ChatColorWhite = ChatColor{15, "white"} ChatStyleObfuscated = ChatStyle{&ChatColor{'k', "obfuscated"}} ChatStyleBold = ChatStyle{&ChatColor{'l', "bold"}} ChatStyleStrikeThrough = ChatStyle{&ChatColor{'m', "strikethrough"}} ChatStyleUnderlined = ChatStyle{&ChatColor{'n', "underlined"}} ChatStyleItalic = ChatStyle{&ChatColor{'o', "italic"}} )
View Source
var ( NETHER = Dimension{ "minecraft:the_nether", 0xFF, 0, uint64Ptr(18000), 0.1, 1, 1, 1, 0, "", 256, 0, 1, 0, 0, } OVERWORLD = Dimension{ "minecraft:overworld", 0x00, 1, nil, 0, 0, 0, 0, 1, "", 256, 0, 0, 1, 1, } END = Dimension{ "minecraft:the_end", 0x01, 0, uint64Ptr(6000), 0, 0, 0, 0, 0, "", 0, 1, 0, 0, 1, } )
View Source
var (
BLOCK_REGISTRY = generateRegistry()
)
Functions ¶
func IsCompatible ¶
func JsonEscape ¶
func JsonMessage ¶
func JsonMessage(s string) json.RawMessage
func PacketTypeHash ¶
Types ¶
type BlockPalette ¶
type BlockRegistry ¶
type BlockRegistry struct { NameToGuid map[string]uint16 GuidToName map[uint16]string // contains filtered or unexported fields }
func (*BlockRegistry) GetBlockId ¶
func (registry *BlockRegistry) GetBlockId(name string, proto Protocol) int
func (*BlockRegistry) GetGuid ¶
func (registry *BlockRegistry) GetGuid(name string) uint16
func (*BlockRegistry) GetLegacyBlockTypeData ¶
func (registry *BlockRegistry) GetLegacyBlockTypeData(name string, proto Protocol) (int, int)
func (*BlockRegistry) GetName ¶
func (registry *BlockRegistry) GetName(guid uint16) string
type BossBarAction ¶
type BossBarAction int
const ( BOSSBAR_ADD BossBarAction = iota BOSSBAR_REMOVE BOSSBAR_UPDATE_HEALTH BOSSBAR_UPDATE_TITLE BOSSBAR_UPDATE_STYLE BOSSBAR_UPDATE_FLAGS )
type BossBarColor ¶
type BossBarColor int
const ( BOSSBAR_COLOR_PINK BossBarColor = iota BOSSBAR_COLOR_BLUE BOSSBAR_COLOR_RED BOSSBAR_COLOR_GREEN BOSSBAR_COLOR_YELLOW BOSSBAR_COLOR_PURPLE BOSSBAR_COLOR_WHITE )
type BossBarDivision ¶
type BossBarDivision int
const ( BOSSBAR_NODIVISION BossBarDivision = iota BOSSBAR_6NOTCHES BOSSBAR_10NOTCHES BOSSBAR_12NOTCHES BOSSBAR_20NOTCHES )
type BufferConfig ¶
type ChatAction ¶
type ChatAction struct { Action string `json:"action"` Value interface{} `json:"value"` }
func ChatClickRunCommand ¶
func ChatClickRunCommand(command string) *ChatAction
func ChatHoverMessage ¶
func ChatHoverMessage(components []IChatComponent) *ChatAction
func ChatHoverText ¶
func ChatHoverText(component string) *ChatAction
type ChatColor ¶
type ChatColor struct {
// contains filtered or unexported fields
}
func (*ChatColor) ChatFormat ¶
type ChatComponent ¶
type ChatComponent struct { Bold bool `json:"bold"` Italic bool `json:"italic"` Underlined bool `json:"underlined"` StrikeThrough bool `json:"strikethrough"` Obfuscated bool `json:"obfuscated"` Color *string `json:"color,omitempty"` Insertion *string `json:"insertion,omitempty"` ClickEvent *ChatAction `json:"clickEvent,omitempty"` HoverEvent *ChatAction `json:"hoverEvent,omitempty"` Extra []IChatComponent `json:"extra,omitempty"` }
func (*ChatComponent) AddExtra ¶
func (component *ChatComponent) AddExtra(extra IChatComponent)
func (*ChatComponent) JSON ¶
func (component *ChatComponent) JSON() (string, error)
func (*ChatComponent) SetBold ¶
func (component *ChatComponent) SetBold(bold bool)
func (*ChatComponent) SetClickEvent ¶
func (component *ChatComponent) SetClickEvent(action *ChatAction)
func (*ChatComponent) SetColor ¶
func (component *ChatComponent) SetColor(color *ChatColor)
func (*ChatComponent) SetExtra ¶
func (component *ChatComponent) SetExtra(extra []IChatComponent)
func (*ChatComponent) SetHoverEvent ¶
func (component *ChatComponent) SetHoverEvent(action *ChatAction)
func (*ChatComponent) SetInsertion ¶
func (component *ChatComponent) SetInsertion(insertion string)
func (*ChatComponent) SetItalic ¶
func (component *ChatComponent) SetItalic(italic bool)
func (*ChatComponent) SetObfuscated ¶
func (component *ChatComponent) SetObfuscated(obfuscated bool)
func (*ChatComponent) SetStrikeThrough ¶
func (component *ChatComponent) SetStrikeThrough(strikeThrough bool)
func (*ChatComponent) SetUnderlined ¶
func (component *ChatComponent) SetUnderlined(underlined bool)
type ChatPosition ¶
type ChatPosition uint8
const ( CHAT_BOX ChatPosition = iota SYSTEM ACTION_BAR )
type Chunk ¶
type Chunk struct { ChunkX int32 ChunkZ int32 Sections [16]*ChunkSection }
func (*Chunk) GetSection ¶
func (chunk *Chunk) GetSection(y int) *ChunkSection
type ChunkBlockPalette ¶
type ChunkBlockPalette struct {
Map []string
}
func (*ChunkBlockPalette) GetContent ¶
func (palette *ChunkBlockPalette) GetContent() []string
func (*ChunkBlockPalette) GetId ¶
func (palette *ChunkBlockPalette) GetId(name string) int
func (*ChunkBlockPalette) GetSize ¶
func (palette *ChunkBlockPalette) GetSize() int
func (*ChunkBlockPalette) RecoverName ¶
func (palette *ChunkBlockPalette) RecoverName(id int) string
type ChunkSection ¶
type ChunkSection struct { Palette BlockPalette Blocks [16 * 16 * 16]int }
func (*ChunkSection) SetBlock ¶
func (section *ChunkSection) SetBlock(x, y, z int, typ string)
type ClientStatusAction ¶
type ClientStatusAction uint8
const ( PERFORM_RESPAWN ClientStatusAction = iota REQUEST_STATS OPEN_INVENTORY )
type CommandNode ¶
type CommandNode struct { Type CommandNodeType Execute func(player *Player, args []string) Children []*CommandNode RedirectNode *CommandNode Name string Parser CommandParser }
func CommandNodeArgument ¶
func CommandNodeArgument( name string, children []*CommandNode, parser CommandParser, execute func(player *Player, args []string)) *CommandNode
func CommandNodeLiteral ¶
func CommandNodeLiteral( name string, children []*CommandNode, execute func(player *Player, args []string)) *CommandNode
type CommandNodeType ¶
type CommandNodeType uint8
type CommandParser ¶
type CommandParserBool ¶
type CommandParserBool struct{}
func (*CommandParserBool) Complete ¶
func (c *CommandParserBool) Complete(arg string) []string
func (*CommandParserBool) GetId ¶
func (c *CommandParserBool) GetId() string
func (*CommandParserBool) GetSuggestion ¶
func (c *CommandParserBool) GetSuggestion() CommandSuggestionType
func (*CommandParserBool) IsArrayValid ¶
func (c *CommandParserBool) IsArrayValid(arg []string) bool
func (*CommandParserBool) IsMultiple ¶
func (c *CommandParserBool) IsMultiple() bool
func (*CommandParserBool) IsValid ¶
func (c *CommandParserBool) IsValid(arg string) bool
type CommandParserDouble ¶
func (*CommandParserDouble) Complete ¶
func (c *CommandParserDouble) Complete(arg string) []string
func (*CommandParserDouble) GetId ¶
func (c *CommandParserDouble) GetId() string
func (*CommandParserDouble) GetSuggestion ¶
func (c *CommandParserDouble) GetSuggestion() CommandSuggestionType
func (*CommandParserDouble) IsArrayValid ¶
func (c *CommandParserDouble) IsArrayValid(arg []string) bool
func (*CommandParserDouble) IsMultiple ¶
func (c *CommandParserDouble) IsMultiple() bool
func (*CommandParserDouble) IsValid ¶
func (c *CommandParserDouble) IsValid(arg string) bool
type CommandParserFloat ¶
func (*CommandParserFloat) Complete ¶
func (c *CommandParserFloat) Complete(arg string) []string
func (*CommandParserFloat) GetId ¶
func (c *CommandParserFloat) GetId() string
func (*CommandParserFloat) GetSuggestion ¶
func (c *CommandParserFloat) GetSuggestion() CommandSuggestionType
func (*CommandParserFloat) IsArrayValid ¶
func (c *CommandParserFloat) IsArrayValid(arg []string) bool
func (*CommandParserFloat) IsMultiple ¶
func (c *CommandParserFloat) IsMultiple() bool
func (*CommandParserFloat) IsValid ¶
func (c *CommandParserFloat) IsValid(arg string) bool
type CommandParserInteger ¶
type CommandParserInteger struct { Min OptInteger Max OptInteger }
func (*CommandParserInteger) Complete ¶
func (c *CommandParserInteger) Complete(arg string) []string
func (*CommandParserInteger) GetId ¶
func (c *CommandParserInteger) GetId() string
func (*CommandParserInteger) GetSuggestion ¶
func (c *CommandParserInteger) GetSuggestion() CommandSuggestionType
func (*CommandParserInteger) IsArrayValid ¶
func (c *CommandParserInteger) IsArrayValid(arg []string) bool
func (*CommandParserInteger) IsMultiple ¶
func (c *CommandParserInteger) IsMultiple() bool
func (*CommandParserInteger) IsValid ¶
func (c *CommandParserInteger) IsValid(arg string) bool
type CommandParserString ¶
type CommandParserString struct {
Format CommandParserStringFormat
}
func (*CommandParserString) Complete ¶
func (c *CommandParserString) Complete(arg string) []string
func (*CommandParserString) GetId ¶
func (c *CommandParserString) GetId() string
func (*CommandParserString) GetSuggestion ¶
func (c *CommandParserString) GetSuggestion() CommandSuggestionType
func (*CommandParserString) IsArrayValid ¶
func (c *CommandParserString) IsArrayValid(arg []string) bool
func (*CommandParserString) IsMultiple ¶
func (c *CommandParserString) IsMultiple() bool
func (*CommandParserString) IsValid ¶
func (c *CommandParserString) IsValid(arg string) bool
type CommandParserStringFormat ¶
type CommandParserStringFormat int
const ( CommandParserStringFormatSingleWord CommandParserStringFormat = iota CommandParserStringFormatGreedyPhrase )
type CommandSuggestionType ¶
type CommandSuggestionType string
const ( CommandSuggestionNone CommandSuggestionType = "" CommandSuggestionAskServer CommandSuggestionType = "minecraft:ask_server" CommandSuggestionAllRecipes CommandSuggestionType = "minecraft:all_recipes" CommandSuggestionAvailableSounds CommandSuggestionType = "minecraft:available_sounds" CommandSuggestionSummonableEntities CommandSuggestionType = "minecraft:summonable_entities" )
type Config ¶
type Config struct { ListenAddress string `json:"listen_address"` MaxPlayers int `json:"max_players"` Motd string `json:"motd"` Restricted bool `json:"restricted"` Logs bool `json:"logs"` Compression bool `json:"enable_compression"` Threshold int `json:"compression_threshold"` BufferConfig BufferConfig `json:"buffer_config"` }
type ConnReadWrite ¶
type ConnReadWrite struct {
// contains filtered or unexported fields
}
func (ConnReadWrite) ReadByte ¶
func (rdrwtr ConnReadWrite) ReadByte() (b byte, err error)
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func (*Core) DeclareCommand ¶
func (c *Core) DeclareCommand(graph *CommandNode)
func (*Core) GetPlayerRegistry ¶
func (c *Core) GetPlayerRegistry() *PlayerRegistry
func (*Core) OnPluginMessage ¶
func (*Core) SetGamemode ¶
type Dimension ¶
type EventCallback ¶
type HackContent ¶
type HackModule ¶
type HackModule struct { Type HackType `json:"type"` Content HackContent `json:"content"` }
type IChatComponent ¶
func BukkitMessageConvert ¶
func BukkitMessageConvert(message string) IChatComponent
type Location ¶
func (*Location) ToPosition ¶
type OptInteger ¶
type PacketBossBar ¶
type PacketBossBar struct { UUID uuid.UUID Action BossBarAction Title string Health float32 Color BossBarColor Division BossBarDivision Flags uint8 }
func (*PacketBossBar) Handle ¶
func (packet *PacketBossBar) Handle(player *Player)
func (*PacketBossBar) Id ¶
func (packet *PacketBossBar) Id() (int, Protocol)
func (*PacketBossBar) Read ¶
func (packet *PacketBossBar) Read(player *Player, length int) (err error)
func (*PacketBossBar) Write ¶
func (packet *PacketBossBar) Write(player *Player) (err error)
type PacketHandshake ¶
func (*PacketHandshake) Handle ¶
func (packet *PacketHandshake) Handle(player *Player)
func (*PacketHandshake) Id ¶
func (packet *PacketHandshake) Id() (int, Protocol)
func (*PacketHandshake) Read ¶
func (packet *PacketHandshake) Read(player *Player, length int) (err error)
func (*PacketHandshake) Write ¶
func (packet *PacketHandshake) Write(player *Player) (err error)
type PacketLoginDisconnect ¶
type PacketLoginDisconnect struct {
Component string
}
func (*PacketLoginDisconnect) Handle ¶
func (packet *PacketLoginDisconnect) Handle(player *Player)
func (*PacketLoginDisconnect) Id ¶
func (packet *PacketLoginDisconnect) Id() (int, Protocol)
func (*PacketLoginDisconnect) Read ¶
func (packet *PacketLoginDisconnect) Read(player *Player, length int) (err error)
func (*PacketLoginDisconnect) Write ¶
func (packet *PacketLoginDisconnect) Write(player *Player) (err error)
type PacketLoginStart ¶
type PacketLoginStart struct {
Username string
}
func (*PacketLoginStart) Handle ¶
func (packet *PacketLoginStart) Handle(player *Player)
func (*PacketLoginStart) Id ¶
func (packet *PacketLoginStart) Id() (int, Protocol)
func (*PacketLoginStart) Read ¶
func (packet *PacketLoginStart) Read(player *Player, length int) (err error)
func (*PacketLoginStart) Write ¶
func (packet *PacketLoginStart) Write(player *Player) (err error)
type PacketLoginSuccess ¶
func (*PacketLoginSuccess) Handle ¶
func (packet *PacketLoginSuccess) Handle(player *Player)
func (*PacketLoginSuccess) Id ¶
func (packet *PacketLoginSuccess) Id() (int, Protocol)
func (*PacketLoginSuccess) Read ¶
func (packet *PacketLoginSuccess) Read(player *Player, length int) (err error)
func (*PacketLoginSuccess) Write ¶
func (packet *PacketLoginSuccess) Write(player *Player) (err error)
type PacketPlayChat ¶
type PacketPlayChat struct {
Message string
}
func (*PacketPlayChat) Handle ¶
func (packet *PacketPlayChat) Handle(player *Player)
func (*PacketPlayChat) Id ¶
func (packet *PacketPlayChat) Id() (int, Protocol)
func (*PacketPlayChat) Read ¶
func (packet *PacketPlayChat) Read(player *Player, length int) (err error)
func (*PacketPlayChat) Write ¶
func (packet *PacketPlayChat) Write(player *Player) (err error)
type PacketPlayChunkData ¶
type PacketPlayChunkData struct { X int32 Z int32 GroundUp bool ServerLightning bool Sections []*ChunkSection Biomes *[]byte BlockEntities []nbt.Compound }
func (*PacketPlayChunkData) Handle ¶
func (packet *PacketPlayChunkData) Handle(player *Player)
func (*PacketPlayChunkData) Id ¶
func (packet *PacketPlayChunkData) Id() (int, Protocol)
func (*PacketPlayChunkData) Read ¶
func (packet *PacketPlayChunkData) Read(player *Player, length int) (err error)
func (*PacketPlayChunkData) Write ¶
func (packet *PacketPlayChunkData) Write(player *Player) (err error)
func (*PacketPlayChunkData) WriteV1_13 ¶
func (packet *PacketPlayChunkData) WriteV1_13(player *Player) (err error)
func (*PacketPlayChunkData) WriteV1_7 ¶
func (packet *PacketPlayChunkData) WriteV1_7(player *Player) (err error)
func (*PacketPlayChunkData) WriteV1_8 ¶
func (packet *PacketPlayChunkData) WriteV1_8(player *Player) (err error)
func (*PacketPlayChunkData) WriteV1_9 ¶
func (packet *PacketPlayChunkData) WriteV1_9(player *Player) (err error)
type PacketPlayClientStatus ¶
type PacketPlayClientStatus struct {
Action ClientStatusAction
}
func (*PacketPlayClientStatus) Handle ¶
func (packet *PacketPlayClientStatus) Handle(player *Player)
func (*PacketPlayClientStatus) Id ¶
func (packet *PacketPlayClientStatus) Id() (int, Protocol)
func (*PacketPlayClientStatus) Read ¶
func (packet *PacketPlayClientStatus) Read(player *Player, length int) (err error)
func (*PacketPlayClientStatus) Write ¶
func (packet *PacketPlayClientStatus) Write(player *Player) (err error)
type PacketPlayDisconnect ¶
type PacketPlayDisconnect struct {
Component string
}
func (*PacketPlayDisconnect) Handle ¶
func (packet *PacketPlayDisconnect) Handle(player *Player)
func (*PacketPlayDisconnect) Id ¶
func (packet *PacketPlayDisconnect) Id() (int, Protocol)
func (*PacketPlayDisconnect) Read ¶
func (packet *PacketPlayDisconnect) Read(player *Player, length int) (err error)
func (*PacketPlayDisconnect) Write ¶
func (packet *PacketPlayDisconnect) Write(player *Player) (err error)
type PacketPlayJoinGame ¶
type PacketPlayJoinGame struct { EntityId uint32 Gamemode Gamemode Dimension Dimension HashedSeed uint64 Difficulty Difficulty MaxPlayers uint8 LevelType LevelType ReducedDebug bool EnableRespawnScreen bool IsDebug bool IsFlat bool }
func (*PacketPlayJoinGame) Handle ¶
func (packet *PacketPlayJoinGame) Handle(player *Player)
func (*PacketPlayJoinGame) Id ¶
func (packet *PacketPlayJoinGame) Id() (int, Protocol)
func (*PacketPlayJoinGame) Read ¶
func (packet *PacketPlayJoinGame) Read(player *Player, length int) (err error)
func (*PacketPlayJoinGame) Write ¶
func (packet *PacketPlayJoinGame) Write(player *Player) (err error)
type PacketPlayKeepAlive ¶
type PacketPlayKeepAlive struct {
Identifier int
}
func (*PacketPlayKeepAlive) Handle ¶
func (packet *PacketPlayKeepAlive) Handle(player *Player)
func (*PacketPlayKeepAlive) Id ¶
func (packet *PacketPlayKeepAlive) Id() (int, Protocol)
func (*PacketPlayKeepAlive) Read ¶
func (packet *PacketPlayKeepAlive) Read(player *Player, length int) (err error)
func (*PacketPlayKeepAlive) Write ¶
func (packet *PacketPlayKeepAlive) Write(player *Player) (err error)
type PacketPlayMessage ¶
type PacketPlayMessage struct { Component string Position ChatPosition Sender uuid.UUID }
func (*PacketPlayMessage) Handle ¶
func (packet *PacketPlayMessage) Handle(player *Player)
func (*PacketPlayMessage) Id ¶
func (packet *PacketPlayMessage) Id() (int, Protocol)
func (*PacketPlayMessage) Read ¶
func (packet *PacketPlayMessage) Read(player *Player, length int) (err error)
func (*PacketPlayMessage) Write ¶
func (packet *PacketPlayMessage) Write(player *Player) (err error)
type PacketPlayParticle ¶
type PacketPlayParticle struct { Type int LongDistance bool X float32 Y float32 Z float32 OffsetX float32 OffsetY float32 OffsetZ float32 ParticleData float32 Count int Data []int }
func (*PacketPlayParticle) Handle ¶
func (packet *PacketPlayParticle) Handle(player *Player)
func (*PacketPlayParticle) Id ¶
func (packet *PacketPlayParticle) Id() (int, Protocol)
func (*PacketPlayParticle) Read ¶
func (packet *PacketPlayParticle) Read(player *Player, length int) (err error)
func (*PacketPlayParticle) Write ¶
func (packet *PacketPlayParticle) Write(player *Player) (err error)
type PacketPlayPlayerAbilities ¶
type PacketPlayPlayerAbilities struct { Invulnerable bool Fly bool CanFly bool Creative bool FlyingSpeed float32 FieldOfView float32 }
func (*PacketPlayPlayerAbilities) Handle ¶
func (packet *PacketPlayPlayerAbilities) Handle(player *Player)
func (*PacketPlayPlayerAbilities) Id ¶
func (packet *PacketPlayPlayerAbilities) Id() (int, Protocol)
func (*PacketPlayPlayerAbilities) Read ¶
func (packet *PacketPlayPlayerAbilities) Read(player *Player, length int) (err error)
func (*PacketPlayPlayerAbilities) Write ¶
func (packet *PacketPlayPlayerAbilities) Write(player *Player) (err error)
type PacketPlayServerDifficulty ¶
type PacketPlayServerDifficulty struct {
Difficulty Difficulty
}
func (*PacketPlayServerDifficulty) Handle ¶
func (packet *PacketPlayServerDifficulty) Handle(player *Player)
func (*PacketPlayServerDifficulty) Id ¶
func (packet *PacketPlayServerDifficulty) Id() (int, Protocol)
func (*PacketPlayServerDifficulty) Read ¶
func (packet *PacketPlayServerDifficulty) Read(player *Player, length int) (err error)
func (*PacketPlayServerDifficulty) Write ¶
func (packet *PacketPlayServerDifficulty) Write(player *Player) (err error)
type PacketPlaySpawnPosition ¶
type PacketPlaySpawnPosition struct {
Position Position
}
func (*PacketPlaySpawnPosition) Handle ¶
func (packet *PacketPlaySpawnPosition) Handle(player *Player)
func (*PacketPlaySpawnPosition) Id ¶
func (packet *PacketPlaySpawnPosition) Id() (int, Protocol)
func (*PacketPlaySpawnPosition) Read ¶
func (packet *PacketPlaySpawnPosition) Read(player *Player, length int) (err error)
func (*PacketPlaySpawnPosition) Write ¶
func (packet *PacketPlaySpawnPosition) Write(player *Player) (err error)
type PacketPlayTabComplete ¶
type PacketPlayTabComplete struct {
Matches []string
}
func (*PacketPlayTabComplete) Handle ¶
func (packet *PacketPlayTabComplete) Handle(player *Player)
func (*PacketPlayTabComplete) Id ¶
func (packet *PacketPlayTabComplete) Id() (int, Protocol)
func (*PacketPlayTabComplete) Read ¶
func (packet *PacketPlayTabComplete) Read(player *Player, length int) (err error)
func (*PacketPlayTabComplete) Write ¶
func (packet *PacketPlayTabComplete) Write(player *Player) (err error)
type PacketPlayTabCompleteServerbound ¶
func (*PacketPlayTabCompleteServerbound) Handle ¶
func (packet *PacketPlayTabCompleteServerbound) Handle(player *Player)
func (*PacketPlayTabCompleteServerbound) Id ¶
func (packet *PacketPlayTabCompleteServerbound) Id() (int, Protocol)
func (*PacketPlayTabCompleteServerbound) Read ¶
func (packet *PacketPlayTabCompleteServerbound) Read(player *Player, length int) (err error)
func (*PacketPlayTabCompleteServerbound) Write ¶
func (packet *PacketPlayTabCompleteServerbound) Write(player *Player) (err error)
type PacketPlayerListHeaderFooter ¶
type PacketPlayerListHeaderFooter struct {}
func (*PacketPlayerListHeaderFooter) Handle ¶
func (packet *PacketPlayerListHeaderFooter) Handle(player *Player)
func (*PacketPlayerListHeaderFooter) Id ¶
func (packet *PacketPlayerListHeaderFooter) Id() (int, Protocol)
func (*PacketPlayerListHeaderFooter) Read ¶
func (packet *PacketPlayerListHeaderFooter) Read(player *Player, length int) (err error)
func (*PacketPlayerListHeaderFooter) Write ¶
func (packet *PacketPlayerListHeaderFooter) Write(player *Player) (err error)
type PacketPlayerPositionLook ¶
type PacketPlayerPositionLook struct { X float64 Y float64 Z float64 Yaw float32 Pitch float32 Flags uint8 TeleportId int }
func (*PacketPlayerPositionLook) Handle ¶
func (packet *PacketPlayerPositionLook) Handle(player *Player)
func (*PacketPlayerPositionLook) Id ¶
func (packet *PacketPlayerPositionLook) Id() (int, Protocol)
func (*PacketPlayerPositionLook) Read ¶
func (packet *PacketPlayerPositionLook) Read(player *Player, length int) (err error)
func (*PacketPlayerPositionLook) Write ¶
func (packet *PacketPlayerPositionLook) Write(player *Player) (err error)
type PacketSetCompression ¶
type PacketSetCompression struct {
Threshold int
}
func (*PacketSetCompression) Handle ¶
func (packet *PacketSetCompression) Handle(player *Player)
func (*PacketSetCompression) Id ¶
func (packet *PacketSetCompression) Id() (int, Protocol)
func (*PacketSetCompression) Read ¶
func (packet *PacketSetCompression) Read(player *Player, length int) (err error)
func (*PacketSetCompression) Write ¶
func (packet *PacketSetCompression) Write(player *Player) (err error)
type PacketStatusPing ¶
type PacketStatusPing struct {
Time uint64
}
func (*PacketStatusPing) Handle ¶
func (packet *PacketStatusPing) Handle(player *Player)
func (*PacketStatusPing) Id ¶
func (packet *PacketStatusPing) Id() (int, Protocol)
func (*PacketStatusPing) Read ¶
func (packet *PacketStatusPing) Read(player *Player, length int) (err error)
func (*PacketStatusPing) Write ¶
func (packet *PacketStatusPing) Write(player *Player) (err error)
type PacketStatusRequest ¶
type PacketStatusRequest struct{}
func (*PacketStatusRequest) Handle ¶
func (packet *PacketStatusRequest) Handle(player *Player)
func (*PacketStatusRequest) Id ¶
func (packet *PacketStatusRequest) Id() (int, Protocol)
func (*PacketStatusRequest) Read ¶
func (packet *PacketStatusRequest) Read(player *Player, length int) (err error)
func (*PacketStatusRequest) Write ¶
func (packet *PacketStatusRequest) Write(player *Player) (err error)
type PacketStatusResponse ¶
type PacketStatusResponse struct {
Response string
}
func (*PacketStatusResponse) Handle ¶
func (packet *PacketStatusResponse) Handle(player *Player)
func (*PacketStatusResponse) Id ¶
func (packet *PacketStatusResponse) Id() (int, Protocol)
func (*PacketStatusResponse) Read ¶
func (packet *PacketStatusResponse) Read(player *Player, length int) (err error)
func (*PacketStatusResponse) Write ¶
func (packet *PacketStatusResponse) Write(player *Player) (err error)
type PacketUpdateHealth ¶
func (*PacketUpdateHealth) Handle ¶
func (packet *PacketUpdateHealth) Handle(player *Player)
func (*PacketUpdateHealth) Id ¶
func (packet *PacketUpdateHealth) Id() (int, Protocol)
func (*PacketUpdateHealth) Read ¶
func (packet *PacketUpdateHealth) Read(player *Player, length int) (err error)
func (*PacketUpdateHealth) Write ¶
func (packet *PacketUpdateHealth) Write(player *Player) (err error)
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
func (*Player) HackClientbound ¶
func (*Player) HackServerbound ¶
func (*Player) HandlePacket ¶
func (*Player) ReadByteArray ¶
func (*Player) ReadFloat32 ¶
func (*Player) ReadFloat64 ¶
func (*Player) ReadNStringLimited ¶
func (*Player) ReadPacket ¶
func (*Player) ReadPacketWithCompression ¶
func (*Player) ReadPacketWithoutCompression ¶
func (*Player) ReadPosition ¶
func (*Player) ReadString ¶
func (*Player) ReadStringLimited ¶
func (*Player) ReadUInt16 ¶
func (*Player) ReadUInt32 ¶
func (*Player) ReadUInt64 ¶
func (*Player) ReadVarInt ¶
func (*Player) SendActionBar ¶
func (p *Player) SendActionBar(message IChatComponent)
func (*Player) SendBukkitMessage ¶
func (*Player) SendMessage ¶
func (p *Player) SendMessage(message IChatComponent)
func (*Player) SendRawActionBar ¶
func (*Player) SendRawMessage ¶
func (*Player) WriteByteArray ¶
func (*Player) WriteFloat32 ¶
func (*Player) WriteFloat64 ¶
func (*Player) WriteLittleEndianUInt16 ¶
func (*Player) WriteNBTCompound ¶
func (*Player) WritePacket ¶
func (*Player) WritePacketWithCompression ¶
func (*Player) WritePacketWithoutCompression ¶
func (*Player) WritePosition ¶
func (*Player) WriteString ¶
func (*Player) WriteStringRestricted ¶
func (*Player) WriteUInt16 ¶
func (*Player) WriteUInt32 ¶
func (*Player) WriteUInt64 ¶
func (*Player) WriteUInt8 ¶
func (*Player) WriteVarInt ¶
type PlayerChatEvent ¶
type PlayerClickType ¶
type PlayerClickType byte
const ( PlayerRightClick PlayerClickType = iota PlayerLeftClick )
type PlayerInteractEvent ¶
type PlayerInteractEvent struct { Player *Player ClickType PlayerClickType }
type PlayerJoinEvent ¶
type PlayerJoinEvent struct {
Player *Player
}
type PlayerKickEvent ¶
type PlayerPreJoinEvent ¶
type PlayerPreJoinEvent struct {
Player *Player
}
type PlayerQuitEvent ¶
type PlayerQuitEvent struct {
Player *Player
}
type PlayerRegistry ¶
type PlayerRegistry struct {
// contains filtered or unexported fields
}
func (*PlayerRegistry) ForEachPlayer ¶
func (registry *PlayerRegistry) ForEachPlayer(fn func(player *Player))
func (*PlayerRegistry) ForEachPlayerAsync ¶
func (registry *PlayerRegistry) ForEachPlayerAsync(fn func(player *Player))
func (*PlayerRegistry) GetPlayerCount ¶
func (registry *PlayerRegistry) GetPlayerCount() int
func (*PlayerRegistry) GetPlayers ¶
func (registry *PlayerRegistry) GetPlayers() []*Player
type PluginMessageEvent ¶
type Protocol ¶
type Protocol uint16
const ( V1_7_2 Protocol = 4 V1_7_6 Protocol = 5 V1_8 Protocol = 47 V1_9 Protocol = 107 V1_9_1 Protocol = 108 V1_9_2 Protocol = 109 V1_9_3 Protocol = 110 V1_10 Protocol = 210 V1_11 Protocol = 315 V1_11_1 Protocol = 316 V1_12 Protocol = 335 V1_12_1 Protocol = 338 V1_12_2 Protocol = 340 V1_13 Protocol = 393 V1_13_1 Protocol = 401 V1_13_2 Protocol = 404 V1_14 Protocol = 477 V1_14_1 Protocol = 480 V1_14_2 Protocol = 485 V1_14_3 Protocol = 490 V1_14_4 Protocol = 498 V1_15 Protocol = 573 V1_15_1 Protocol = 575 V1_15_2 Protocol = 578 V1_16 Protocol = 735 V1_16_1 Protocol = 736 V1_16_2 Protocol = 751 V1_16_3 Protocol = 753 V1_16_4 Protocol = 754 )
type ScoreboardPosition ¶
type ScoreboardPosition uint8
const ( LIST ScoreboardPosition = iota SIDEBAR BELOW_NAME )
type StringChatComponent ¶
type StringChatComponent struct { Text string `json:"text"` *ChatComponent }
func ChatMessage ¶
func ChatMessage(text string) *StringChatComponent
func (*StringChatComponent) JSON ¶
func (component *StringChatComponent) JSON() (string, error)
func (*StringChatComponent) SetText ¶
func (component *StringChatComponent) SetText(text string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.