minecraft

package
v0.0.0-...-0d76806 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2014 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STRING_VERSION = string("1.8-pre3")
	MAGIC          = string("§")

	PACKET_SERVER_HANDSHAKE = 0x00

	PACKET_CLIENT_KEEPALIVE                     = 0x00
	PACKET_CLIENT_JOIN_GAME                     = 0x01
	PACKET_CLIENT_CHAT                          = 0x02
	PACKET_CLIENT_TIME_UPDATE                   = 0x03
	PACKET_CLIENT_ENTITY_EQUIPMENT              = 0x04
	PACKET_CLIENT_SPAWN_POSITION                = 0x05
	PACKET_CLIENT_UPDATE_HEALTH                 = 0x06
	PACKET_CLIENT_RESPAWN                       = 0x07
	PACKET_CLIENT_PLAYER_POSITION_AND_LOOK      = 0x08
	PACKET_CLIENT_HELD_ITEM_CHANGE              = 0x09
	PACKET_CLIENT_USE_BED                       = 0x0A
	PACKET_CLIENT_ANIMATION                     = 0x0B
	PACKET_CLIENT_SPAWN_PLAYER                  = 0x0C
	PACKET_CLIENT_COLLECT_ITEM                  = 0x0D
	PACKET_CLIENT_SPAWN_OBJECT                  = 0x0E
	PACKET_CLIENT_SPAWN_MOB                     = 0x0F
	PACKET_CLIENT_SPAWN_PAINTING                = 0x10
	PACKET_CLIENT_SPAWN_EXPERIENCE_ORB          = 0x11
	PACKET_CLIENT_ENTITY_VELOCITY               = 0x12
	PACKET_CLIENT_DESTROY_ENTITIES              = 0x13
	PACKET_CLIENT_ENTITY                        = 0x14
	PACKET_CLIENT_ENTITY_RELATIVE_MOVE          = 0x15
	PACKET_CLIENT_ENTITY_LOOK                   = 0x16
	PACKET_CLIENT_ENTITY_LOOK_AND_RELATIVE_MOVE = 0x17
	PACKET_CLIENT_ENTITY_TELEPORT               = 0x18
	PACKET_CLIENT_ENTITY_HEAD_LOOK              = 0x19
	PACKET_CLIENT_ENTITY_STATUS                 = 0x1A
	PACKET_CLIENT_ATTACH_ENTITY                 = 0x1B
	PACKET_CLIENT_ENTITY_METADATA               = 0x1C
	PACKET_CLIENT_ENTITY_EFFECT                 = 0x1D
	PACKET_CLIENT_REMOVE_ENTITY_EFFECT          = 0x1E
	PACKET_CLIENT_SET_EXPERIENCE                = 0x1F
	PACKET_CLIENT_ENTITY_PROPERTIES             = 0x20
	PACKET_CLIENT_CHUNK_DATA                    = 0x21
	PACKET_CLIENT_MULTI_BLOCK_CHANGE            = 0x22
	PACKET_CLIENT_BLOCK_CHANGE                  = 0x23
	PACKET_CLIENT_BLOCK_ACTION                  = 0x24
	PACKET_CLIENT_BLOCK_BREAK_ANIMATION         = 0x25
	PACKET_CLIENT_MAP_CHUNK_BULK                = 0x26
	PACKET_CLIENT_EXPLOSION                     = 0x27
	PACKET_CLIENT_EFFECT                        = 0x28
	PACKET_CLIENT_SOUND_EFFECT                  = 0x29
	PACKET_CLIENT_PARTICLE                      = 0x2A
	PACKET_CLIENT_CHANGE_GAME_STATE             = 0x2B
	PACKET_CLIENT_SPAWN_GLOBAL_ENTITY           = 0x2C
	PACKET_CLIENT_OPEN_WINDOW                   = 0x2D
	PACKET_CLIENT_CLOSE_WINDOW                  = 0x2E
	PACKET_CLIENT_SET_SLOT                      = 0x2F
	PACKET_CLIENT_WINDOW_ITEMS                  = 0x30
	PACKET_CLIENT_WINDOW_PROPERTY               = 0x31
	PACKET_CLIENT_CONFIRM_TRANSACTION           = 0x32
	PACKET_CLIENT_UPDATE_SIGN                   = 0x33
	PACKET_CLIENT_MAPS                          = 0x34
	PACKET_CLIENT_UPDATE_BLOCK_ENTITY           = 0x35
	PACKET_CLIENT_SIGN_EDITOR_OPEN              = 0x36
	PACKET_CLIENT_STATISTICS                    = 0x37
	PACKET_CLIENT_PLAYER_LIST                   = 0x38
	PACKET_CLIENT_PLAYER_ABILITIES              = 0x39
	PACKET_CLIENT_TAB_COMPLETE                  = 0x3A
	PACKET_CLIENT_SCOREBOARD_OBJECTIVE          = 0x3B
	PACKET_CLIENT_UPDATE_SCORE                  = 0x3C
	PACKET_CLIENT_DISPLAY_SCOREBOARD            = 0x3D
	PACKET_CLIENT_TEAMS                         = 0x3E
	PACKET_CLIENT_PLUGIN_MESSAGE                = 0x3F
	PACKET_CLIENT_DISCONNECT                    = 0x40
	PACKET_CLIENT_DIFFICULTY                    = 0x41
	PACKET_CLIENT_COMBAT_EVENT                  = 0x42
	PACKET_CLIENT_CAMERA                        = 0x43
	PACKET_CLIENT_WORLD_BORDER                  = 0x44
	PACKET_CLIENT_TITLE                         = 0x45
	PACKET_CLIENT_SET_COMPRESSION               = 0x46
	PACKET_CLIENT_PLAYER_LIST_HEAD_FOOT         = 0x47
	PACKET_CLIENT_RESOURCE_PACK                 = 0x48
	PACKET_CLIENT_UPDATE_ENTITY_NBT             = 0x49
	PACKET_SERVER_KEEPALIVE                     = 0x00
	PACKET_SERVER_CHAT                          = 0x01
	PACKET_SERVER_USE_ENTITY                    = 0x02
	PACKET_SERVER_PLAYER                        = 0x03
	PACKET_SERVER_PLAYER_POSITION               = 0x04
	PACKET_SERVER_PLAYER_LOOK                   = 0x05
	PACKET_SERVER_PLAYER_LOOK_AND_POSITION      = 0x06
	PACKET_SERVER_PLAYER_DIGGING                = 0x07
	PACKET_SERVER_PLAYER_BLOCK_PLACEMENT        = 0x08
	PACKET_SERVER_HELD_ITEM_CHANGE              = 0x09
	PACKET_SERVER_ANIMATION                     = 0x0A
	PACKET_SERVER_ENTITY_ACTION                 = 0x0B
	PACKET_SERVER_STEER_VEHICLE                 = 0x0C
	PACKET_SERVER_CLOSE_WINDOW                  = 0x0D
	PACKET_SERVER_CLICK_WINDOW                  = 0x0E
	PACKET_SERVER_CONFIRM_TRANSACTION           = 0x0F
	PACKET_SERVER_CREATIVE_INVENTORY_ACTION     = 0x10
	PACKET_SERVER_ENCHANT_ITEM                  = 0x11
	PACKET_SERVER_UPDATE_SIGN                   = 0x12
	PACKET_SERVER_PLAYER_ABILITIES              = 0x13
	PACKET_SERVER_TAB_COMPLETE                  = 0x14
	PACKET_SERVER_CLIENT_SETTINGS               = 0x15
	PACKET_SERVER_CLIENT_STATUS                 = 0x16
	PACKET_SERVER_PLUGIN_MESSAGE                = 0x17
	PACKET_SERVER_SPECTATE                      = 0x18
	PACKET_SERVER_RESOURCE_PACK_STATUS          = 0x19

	PACKET_CLIENT_STATUS_RESPONSE = 0x00
	PACKET_CLIENT_STATUS_PING     = 0x01
	PACKET_SERVER_STATUS_REQUEST  = 0x00
	PACKET_SERVER_STATUS_PING     = 0x01

	PACKET_CLIENT_LOGIN_DISCONNECT       = 0x00
	PACKET_CLIENT_LOGIN_ENCRYPT_REQUEST  = 0x01
	PACKET_CLIENT_LOGIN_SUCCESS          = 0x02
	PACKET_CLIENT_LOGIN_SET_COMPRESSION  = 0x03
	PACKET_SERVER_LOGIN_START            = 0x00
	PACKET_SERVER_LOGIN_ENCRYPT_RESPONSE = 0x01
)
View Source
const (
	PACKET_CLIENT_PLAYER_LIST_ACTION_ADD                 = 0
	PACKET_CLIENT_PLAYER_LIST_ACTION_UPDATE_GAMEMODE     = 1
	PACKET_CLIENT_PLAYER_LIST_ACTION_UPDATE_LATENCY      = 2
	PACKET_CLIENT_PLAYER_LIST_ACTION_UPDATE_DISPLAY_NAME = 3
	PACKET_CLIENT_PLAYER_LIST_ACTION_REMOVE              = 4
)
View Source
const (
	PACKET_CLIENT_SCOREBOARD_OBJECTIVE_ACTION_ADD    = int8(0)
	PACKET_CLIENT_SCOREBOARD_OBJECTIVE_ACTION_REMOVE = int8(1)
	PACKET_CLIENT_SCOREBOARD_OBJECTIVE_ACTION_UPDATE = int8(2)
)
View Source
const (
	PACKET_CLIENT_TEAMS_ACTION_ADD            = int8(0)
	PACKET_CLIENT_TEAMS_ACTION_REMOVE         = int8(1)
	PACKET_CLIENT_TEAMS_ACTION_INFO_UPDATE    = int8(2)
	PACKET_CLIENT_TEAMS_ACTION_PLAYERS_ADD    = int8(3)
	PACKET_CLIENT_TEAMS_ACTION_PLAYERS_REMOVE = int8(4)
)

Variables

View Source
var HandshakePacketClientCodec = HandshakePacketServerCodec.Flip()
View Source
var HandshakePacketServerCodec = packet.NewPacketCodecRegistryDual([]packet.PacketCodec{}, []packet.PacketCodec{
	PACKET_SERVER_HANDSHAKE: new(packetServerHandshakeCodec),
})
View Source
var LoginPacketClientCodec = LoginPacketServerCodec.Flip()
View Source
var LoginPacketServerCodec = packet.NewPacketCodecRegistryDual([]packet.PacketCodec{
	PACKET_CLIENT_LOGIN_DISCONNECT:      new(packetClientLoginDisconnectCodec),
	PACKET_CLIENT_LOGIN_ENCRYPT_REQUEST: new(packetClientLoginEncryptRequestCodec),
	PACKET_CLIENT_LOGIN_SUCCESS:         new(packetClientLoginSuccessCodec),
	PACKET_CLIENT_LOGIN_SET_COMPRESSION: new(packetClientLoginSetCompressionCodec),
}, []packet.PacketCodec{
	PACKET_SERVER_LOGIN_START:            new(packetServerLoginStartCodec),
	PACKET_SERVER_LOGIN_ENCRYPT_RESPONSE: new(packetServerLoginEncryptResponseCodec),
})
View Source
var Play17PacketServerEntityIntPositions = [][]int{
	PACKET_SERVER_USE_ENTITY:    {0},
	PACKET_SERVER_ANIMATION:     {0},
	PACKET_SERVER_ENTITY_ACTION: {0},
}
View Source
var Play17PacketServerEntityVarIntPositions = []bool{}
View Source
var PlayPacketClientCodec = PlayPacketServerCodec.Flip()
View Source
var PlayPacketClientEntityIntPositions = [][]int{
	PACKET_CLIENT_ENTITY_STATUS: {0},
	PACKET_CLIENT_ATTACH_ENTITY: {0, 4},
}
View Source
var PlayPacketServerCodec = packet.NewPacketCodecRegistryDual([]packet.PacketCodec{
	PACKET_CLIENT_KEEPALIVE:                     NewPacketGenericCodec(PACKET_CLIENT_KEEPALIVE),
	PACKET_CLIENT_JOIN_GAME:                     new(packetClientJoinGameCodec),
	PACKET_CLIENT_CHAT:                          NewPacketGenericCodec(PACKET_CLIENT_CHAT),
	PACKET_CLIENT_TIME_UPDATE:                   NewPacketGenericCodec(PACKET_CLIENT_TIME_UPDATE),
	PACKET_CLIENT_ENTITY_EQUIPMENT:              NewPacketGenericCodec(PACKET_CLIENT_ENTITY_EQUIPMENT),
	PACKET_CLIENT_SPAWN_POSITION:                NewPacketGenericCodec(PACKET_CLIENT_SPAWN_POSITION),
	PACKET_CLIENT_UPDATE_HEALTH:                 NewPacketGenericCodec(PACKET_CLIENT_UPDATE_HEALTH),
	PACKET_CLIENT_RESPAWN:                       new(packetClientRespawnCodec),
	PACKET_CLIENT_PLAYER_POSITION_AND_LOOK:      NewPacketGenericCodec(PACKET_CLIENT_PLAYER_POSITION_AND_LOOK),
	PACKET_CLIENT_HELD_ITEM_CHANGE:              NewPacketGenericCodec(PACKET_CLIENT_HELD_ITEM_CHANGE),
	PACKET_CLIENT_USE_BED:                       NewPacketGenericCodec(PACKET_CLIENT_USE_BED),
	PACKET_CLIENT_ANIMATION:                     NewPacketGenericCodec(PACKET_CLIENT_ANIMATION),
	PACKET_CLIENT_SPAWN_PLAYER:                  NewPacketGenericCodec(PACKET_CLIENT_SPAWN_PLAYER),
	PACKET_CLIENT_COLLECT_ITEM:                  NewPacketGenericCodec(PACKET_CLIENT_COLLECT_ITEM),
	PACKET_CLIENT_SPAWN_OBJECT:                  NewPacketGenericCodec(PACKET_CLIENT_SPAWN_OBJECT),
	PACKET_CLIENT_SPAWN_MOB:                     NewPacketGenericCodec(PACKET_CLIENT_SPAWN_MOB),
	PACKET_CLIENT_SPAWN_PAINTING:                NewPacketGenericCodec(PACKET_CLIENT_SPAWN_PAINTING),
	PACKET_CLIENT_SPAWN_EXPERIENCE_ORB:          NewPacketGenericCodec(PACKET_CLIENT_SPAWN_EXPERIENCE_ORB),
	PACKET_CLIENT_ENTITY_VELOCITY:               NewPacketGenericCodec(PACKET_CLIENT_ENTITY_VELOCITY),
	PACKET_CLIENT_DESTROY_ENTITIES:              NewPacketGenericCodec(PACKET_CLIENT_DESTROY_ENTITIES),
	PACKET_CLIENT_ENTITY:                        NewPacketGenericCodec(PACKET_CLIENT_ENTITY),
	PACKET_CLIENT_ENTITY_RELATIVE_MOVE:          NewPacketGenericCodec(PACKET_CLIENT_ENTITY_RELATIVE_MOVE),
	PACKET_CLIENT_ENTITY_LOOK:                   NewPacketGenericCodec(PACKET_CLIENT_ENTITY_LOOK),
	PACKET_CLIENT_ENTITY_LOOK_AND_RELATIVE_MOVE: NewPacketGenericCodec(PACKET_CLIENT_ENTITY_LOOK_AND_RELATIVE_MOVE),
	PACKET_CLIENT_ENTITY_TELEPORT:               NewPacketGenericCodec(PACKET_CLIENT_ENTITY_TELEPORT),
	PACKET_CLIENT_ENTITY_HEAD_LOOK:              NewPacketGenericCodec(PACKET_CLIENT_ENTITY_HEAD_LOOK),
	PACKET_CLIENT_ENTITY_STATUS:                 NewPacketGenericCodec(PACKET_CLIENT_ENTITY_STATUS),
	PACKET_CLIENT_ATTACH_ENTITY:                 NewPacketGenericCodec(PACKET_CLIENT_ATTACH_ENTITY),
	PACKET_CLIENT_ENTITY_METADATA:               NewPacketGenericCodec(PACKET_CLIENT_ENTITY_METADATA),
	PACKET_CLIENT_ENTITY_EFFECT:                 NewPacketGenericCodec(PACKET_CLIENT_ENTITY_EFFECT),
	PACKET_CLIENT_REMOVE_ENTITY_EFFECT:          NewPacketGenericCodec(PACKET_CLIENT_REMOVE_ENTITY_EFFECT),
	PACKET_CLIENT_SET_EXPERIENCE:                NewPacketGenericCodec(PACKET_CLIENT_SET_EXPERIENCE),
	PACKET_CLIENT_ENTITY_PROPERTIES:             NewPacketGenericCodec(PACKET_CLIENT_ENTITY_PROPERTIES),
	PACKET_CLIENT_CHUNK_DATA:                    NewPacketGenericCodec(PACKET_CLIENT_CHUNK_DATA),
	PACKET_CLIENT_MULTI_BLOCK_CHANGE:            NewPacketGenericCodec(PACKET_CLIENT_MULTI_BLOCK_CHANGE),
	PACKET_CLIENT_BLOCK_CHANGE:                  NewPacketGenericCodec(PACKET_CLIENT_BLOCK_CHANGE),
	PACKET_CLIENT_BLOCK_ACTION:                  NewPacketGenericCodec(PACKET_CLIENT_BLOCK_ACTION),
	PACKET_CLIENT_BLOCK_BREAK_ANIMATION:         NewPacketGenericCodec(PACKET_CLIENT_BLOCK_BREAK_ANIMATION),
	PACKET_CLIENT_MAP_CHUNK_BULK:                NewPacketGenericCodec(PACKET_CLIENT_MAP_CHUNK_BULK),
	PACKET_CLIENT_EXPLOSION:                     NewPacketGenericCodec(PACKET_CLIENT_EXPLOSION),
	PACKET_CLIENT_EFFECT:                        NewPacketGenericCodec(PACKET_CLIENT_EFFECT),
	PACKET_CLIENT_SOUND_EFFECT:                  NewPacketGenericCodec(PACKET_CLIENT_SOUND_EFFECT),
	PACKET_CLIENT_PARTICLE:                      NewPacketGenericCodec(PACKET_CLIENT_PARTICLE),
	PACKET_CLIENT_CHANGE_GAME_STATE:             NewPacketGenericCodec(PACKET_CLIENT_CHANGE_GAME_STATE),
	PACKET_CLIENT_SPAWN_GLOBAL_ENTITY:           NewPacketGenericCodec(PACKET_CLIENT_SPAWN_GLOBAL_ENTITY),
	PACKET_CLIENT_OPEN_WINDOW:                   NewPacketGenericCodec(PACKET_CLIENT_OPEN_WINDOW),
	PACKET_CLIENT_CLOSE_WINDOW:                  NewPacketGenericCodec(PACKET_CLIENT_CLOSE_WINDOW),
	PACKET_CLIENT_SET_SLOT:                      NewPacketGenericCodec(PACKET_CLIENT_SET_SLOT),
	PACKET_CLIENT_WINDOW_ITEMS:                  NewPacketGenericCodec(PACKET_CLIENT_WINDOW_ITEMS),
	PACKET_CLIENT_WINDOW_PROPERTY:               NewPacketGenericCodec(PACKET_CLIENT_WINDOW_PROPERTY),
	PACKET_CLIENT_CONFIRM_TRANSACTION:           NewPacketGenericCodec(PACKET_CLIENT_CONFIRM_TRANSACTION),
	PACKET_CLIENT_UPDATE_SIGN:                   NewPacketGenericCodec(PACKET_CLIENT_UPDATE_SIGN),
	PACKET_CLIENT_MAPS:                          NewPacketGenericCodec(PACKET_CLIENT_MAPS),
	PACKET_CLIENT_UPDATE_BLOCK_ENTITY:           NewPacketGenericCodec(PACKET_CLIENT_UPDATE_BLOCK_ENTITY),
	PACKET_CLIENT_SIGN_EDITOR_OPEN:              NewPacketGenericCodec(PACKET_CLIENT_SIGN_EDITOR_OPEN),
	PACKET_CLIENT_STATISTICS:                    NewPacketGenericCodec(PACKET_CLIENT_STATISTICS),
	PACKET_CLIENT_PLAYER_LIST:                   new(packetClientPlayerListCodec),
	PACKET_CLIENT_PLAYER_ABILITIES:              NewPacketGenericCodec(PACKET_CLIENT_PLAYER_ABILITIES),
	PACKET_CLIENT_TAB_COMPLETE:                  NewPacketGenericCodec(PACKET_CLIENT_TAB_COMPLETE),
	PACKET_CLIENT_SCOREBOARD_OBJECTIVE:          new(packetClientScoreboardObjectiveCodec),
	PACKET_CLIENT_UPDATE_SCORE:                  NewPacketGenericCodec(PACKET_CLIENT_UPDATE_SCORE),
	PACKET_CLIENT_DISPLAY_SCOREBOARD:            NewPacketGenericCodec(PACKET_CLIENT_DISPLAY_SCOREBOARD),
	PACKET_CLIENT_TEAMS:                         new(packetClientTeamsCodec),
	PACKET_CLIENT_PLUGIN_MESSAGE:                NewPacketGenericCodec(PACKET_CLIENT_PLUGIN_MESSAGE),
	PACKET_CLIENT_DISCONNECT:                    new(packetClientDisconnectCodec),
	PACKET_CLIENT_DIFFICULTY:                    NewPacketGenericCodec(PACKET_CLIENT_DIFFICULTY),
	PACKET_CLIENT_COMBAT_EVENT:                  NewPacketGenericCodec(PACKET_CLIENT_COMBAT_EVENT),
	PACKET_CLIENT_CAMERA:                        NewPacketGenericCodec(PACKET_CLIENT_CAMERA),
	PACKET_CLIENT_WORLD_BORDER:                  NewPacketGenericCodec(PACKET_CLIENT_WORLD_BORDER),
	PACKET_CLIENT_TITLE:                         NewPacketGenericCodec(PACKET_CLIENT_TITLE),
	PACKET_CLIENT_SET_COMPRESSION:               new(packetClientSetCompressionCodec),
	PACKET_CLIENT_PLAYER_LIST_HEAD_FOOT:         NewPacketGenericCodec(PACKET_CLIENT_PLAYER_LIST_HEAD_FOOT),
	PACKET_CLIENT_RESOURCE_PACK:                 NewPacketGenericCodec(PACKET_CLIENT_RESOURCE_PACK),
	PACKET_CLIENT_UPDATE_ENTITY_NBT:             NewPacketGenericCodec(PACKET_CLIENT_UPDATE_ENTITY_NBT),
}, []packet.PacketCodec{
	PACKET_SERVER_KEEPALIVE:                 NewPacketGenericCodec(PACKET_SERVER_KEEPALIVE),
	PACKET_SERVER_CHAT:                      NewPacketGenericCodec(PACKET_SERVER_CHAT),
	PACKET_SERVER_USE_ENTITY:                NewPacketGenericCodec(PACKET_SERVER_USE_ENTITY),
	PACKET_SERVER_PLAYER:                    NewPacketGenericCodec(PACKET_SERVER_PLAYER),
	PACKET_SERVER_PLAYER_POSITION:           NewPacketGenericCodec(PACKET_SERVER_PLAYER_POSITION),
	PACKET_SERVER_PLAYER_LOOK:               NewPacketGenericCodec(PACKET_SERVER_PLAYER_LOOK),
	PACKET_SERVER_PLAYER_LOOK_AND_POSITION:  NewPacketGenericCodec(PACKET_SERVER_PLAYER_LOOK_AND_POSITION),
	PACKET_SERVER_PLAYER_DIGGING:            NewPacketGenericCodec(PACKET_SERVER_PLAYER_DIGGING),
	PACKET_SERVER_PLAYER_BLOCK_PLACEMENT:    NewPacketGenericCodec(PACKET_SERVER_PLAYER_BLOCK_PLACEMENT),
	PACKET_SERVER_HELD_ITEM_CHANGE:          NewPacketGenericCodec(PACKET_SERVER_HELD_ITEM_CHANGE),
	PACKET_SERVER_ANIMATION:                 NewPacketGenericCodec(PACKET_SERVER_ANIMATION),
	PACKET_SERVER_ENTITY_ACTION:             NewPacketGenericCodec(PACKET_SERVER_ENTITY_ACTION),
	PACKET_SERVER_STEER_VEHICLE:             NewPacketGenericCodec(PACKET_SERVER_STEER_VEHICLE),
	PACKET_SERVER_CLOSE_WINDOW:              NewPacketGenericCodec(PACKET_SERVER_CLOSE_WINDOW),
	PACKET_SERVER_CLICK_WINDOW:              NewPacketGenericCodec(PACKET_SERVER_CLICK_WINDOW),
	PACKET_SERVER_CONFIRM_TRANSACTION:       NewPacketGenericCodec(PACKET_SERVER_CONFIRM_TRANSACTION),
	PACKET_SERVER_CREATIVE_INVENTORY_ACTION: NewPacketGenericCodec(PACKET_SERVER_CREATIVE_INVENTORY_ACTION),
	PACKET_SERVER_ENCHANT_ITEM:              NewPacketGenericCodec(PACKET_SERVER_ENCHANT_ITEM),
	PACKET_SERVER_UPDATE_SIGN:               NewPacketGenericCodec(PACKET_SERVER_UPDATE_SIGN),
	PACKET_SERVER_PLAYER_ABILITIES:          NewPacketGenericCodec(PACKET_SERVER_PLAYER_ABILITIES),
	PACKET_SERVER_TAB_COMPLETE:              NewPacketGenericCodec(PACKET_SERVER_TAB_COMPLETE),
	PACKET_SERVER_CLIENT_SETTINGS:           new(packetServerClientSettingsCodec),
	PACKET_SERVER_CLIENT_STATUS:             NewPacketGenericCodec(PACKET_SERVER_CLIENT_STATUS),
	PACKET_SERVER_PLUGIN_MESSAGE:            new(packetServerPluginMessageCodec),
	PACKET_SERVER_SPECTATE:                  NewPacketGenericCodec(PACKET_SERVER_SPECTATE),
	PACKET_SERVER_RESOURCE_PACK_STATUS:      NewPacketGenericCodec(PACKET_SERVER_RESOURCE_PACK_STATUS),
})
View Source
var PlayPacketServerEntityIntPositions = [][]int{}
View Source
var PlayPacketServerEntityVarIntPositions = []bool{
	PACKET_SERVER_USE_ENTITY:    true,
	PACKET_SERVER_ENTITY_ACTION: true,
}
View Source
var StatusPacketClientCodec = StatusPacketServerCodec.Flip()
View Source
var StatusPacketServerCodec = packet.NewPacketCodecRegistryDual([]packet.PacketCodec{
	PACKET_CLIENT_STATUS_RESPONSE: new(packetClientStatusResponseCodec),
	PACKET_CLIENT_STATUS_PING:     new(packetClientStatusPingCodec),
}, []packet.PacketCodec{
	PACKET_SERVER_STATUS_REQUEST: new(packetServerStatusRequestCodec),
	PACKET_SERVER_STATUS_PING:    new(packetServerStatusPingCodec),
})
View Source
var Versions = []int{46}

Functions

func Colorize

func Colorize(in string) (out string)

func NewCFB8Decrypt

func NewCFB8Decrypt(block cipher.Block, iv []byte) (stream cipher.Stream)

func NewCFB8Encrypt

func NewCFB8Encrypt(block cipher.Block, iv []byte) (stream cipher.Stream)

func NewPacketGenericCodec

func NewPacketGenericCodec(id int) (this *packetGenericCodec)

Types

type PacketClientDisconnect

type PacketClientDisconnect struct {
	Json string
}

func NewPacketClientDisconnect

func NewPacketClientDisconnect(json string) (this *PacketClientDisconnect)

func (*PacketClientDisconnect) Id

func (this *PacketClientDisconnect) Id() int

type PacketClientJoinGame

type PacketClientJoinGame struct {
	EntityId         int32
	Gamemode         int8
	Dimension        int8
	Difficulty       int8
	MaxPlayers       int8
	LevelType        string
	ReducedDebugInfo bool
}

func NewPacketClientJoinGame

func NewPacketClientJoinGame(entityId int32, gamemode int8, dimension int8, difficulty int8, maxPlayers int8, levelType string, reducedDebugInfo bool) (this *PacketClientJoinGame)

func (*PacketClientJoinGame) Id

func (this *PacketClientJoinGame) Id() int

type PacketClientLoginDisconnect

type PacketClientLoginDisconnect struct {
	Json string
}

func NewPacketClientLoginDisconnect

func NewPacketClientLoginDisconnect(json string) (this *PacketClientLoginDisconnect)

func (*PacketClientLoginDisconnect) Id

func (this *PacketClientLoginDisconnect) Id() int

type PacketClientLoginEncryptRequest

type PacketClientLoginEncryptRequest struct {
	ServerId    string
	PublicKey   []byte
	VerifyToken []byte
}

func NewPacketClientLoginEncryptRequest

func NewPacketClientLoginEncryptRequest(serverId string, publicKey []byte, verifyToken []byte) (this *PacketClientLoginEncryptRequest)

func (*PacketClientLoginEncryptRequest) Id

type PacketClientLoginSetCompression

type PacketClientLoginSetCompression struct {
	Threshold int
}

func NewPacketClientLoginSetCompression

func NewPacketClientLoginSetCompression(threshold int) (this *PacketClientLoginSetCompression)

func (*PacketClientLoginSetCompression) Id

type PacketClientLoginSuccess

type PacketClientLoginSuccess struct {
	UUID string
	Name string
}

func NewPacketClientLoginSuccess

func NewPacketClientLoginSuccess(uuid string, name string) (this *PacketClientLoginSuccess)

func (*PacketClientLoginSuccess) Id

func (this *PacketClientLoginSuccess) Id() int

type PacketClientPlayerList

type PacketClientPlayerList struct {
	Action int
	Items  []PacketClientPlayerListItem
}

func NewPacketClientPlayerList

func NewPacketClientPlayerList(action int, items []PacketClientPlayerListItem) (this *PacketClientPlayerList)

func (*PacketClientPlayerList) Id

func (this *PacketClientPlayerList) Id() int

type PacketClientPlayerListAddPlayer

type PacketClientPlayerListAddPlayer struct {
	Name        string
	Properties  []PacketClientPlayerListAddPlayerProperty
	Gamemode    int
	Latency     int
	DisplayName string
}

type PacketClientPlayerListAddPlayerProperty

type PacketClientPlayerListAddPlayerProperty struct {
	Name      string
	Value     string
	Signature string
}

type PacketClientPlayerListItem

type PacketClientPlayerListItem struct {
	UUID uuid.UUID
	Info interface{}
}

type PacketClientPlayerListUpdateDisplayName

type PacketClientPlayerListUpdateDisplayName struct {
	DisplayName string
}

type PacketClientPlayerListUpdateGamemode

type PacketClientPlayerListUpdateGamemode struct {
	Gamemode int
}

type PacketClientPlayerListUpdateLatency

type PacketClientPlayerListUpdateLatency struct {
	Latency int
}

type PacketClientRespawn

type PacketClientRespawn struct {
	Dimension  int32
	Difficulty int8
	Gamemode   int8
	LevelType  string
}

func NewPacketClientRespawn

func NewPacketClientRespawn(dimension int32, difficulty int8, gamemode int8, levelType string) (this *PacketClientRespawn)

func (*PacketClientRespawn) Id

func (this *PacketClientRespawn) Id() int

type PacketClientScoreboardObjective

type PacketClientScoreboardObjective struct {
	Name   string
	Action int8
	Value  string
	Type   string
}

func NewPacketClientScoreboardObjectiveAdd

func NewPacketClientScoreboardObjectiveAdd(name string, value string, stype string) (this *PacketClientScoreboardObjective)

func NewPacketClientScoreboardObjectiveRemove

func NewPacketClientScoreboardObjectiveRemove(name string) (this *PacketClientScoreboardObjective)

func NewPacketClientScoreboardObjectiveUpdate

func NewPacketClientScoreboardObjectiveUpdate(name string, value string, stype string) (this *PacketClientScoreboardObjective)

func (*PacketClientScoreboardObjective) Id

type PacketClientSetCompression

type PacketClientSetCompression struct {
	Threshold int
}

func NewPacketClientSetCompression

func NewPacketClientSetCompression(threshold int) (this *PacketClientSetCompression)

func (*PacketClientSetCompression) Id

func (this *PacketClientSetCompression) Id() int

type PacketClientStatusPing

type PacketClientStatusPing struct {
	Time int64
}

func NewPacketClientStatusPing

func NewPacketClientStatusPing(time int64) (this *PacketClientStatusPing)

func (*PacketClientStatusPing) Id

func (this *PacketClientStatusPing) Id() int

type PacketClientStatusResponse

type PacketClientStatusResponse struct {
	Json string
}

func NewPacketClientStatusResponse

func NewPacketClientStatusResponse(json string) (this *PacketClientStatusResponse)

func (*PacketClientStatusResponse) Id

func (this *PacketClientStatusResponse) Id() int

type PacketClientTeams

type PacketClientTeams struct {
	Name              string
	Action            int8
	DisplayName       string
	Prefix            string
	Suffix            string
	FriendlyFire      int8
	NameTagVisibility string
	Color             int8
	Players           []string
}

func NewPacketClientTeamsAdd

func NewPacketClientTeamsAdd(name string, displayName string, prefix string, suffix string, friendlyFire int8, nameTagVisibility string, color int8, players []string) (this *PacketClientTeams)

func NewPacketClientTeamsInfoUpdate

func NewPacketClientTeamsInfoUpdate(name string, displayName string, prefix string, suffix string, friendlyFire int8, nameTagVisibility string, color int8) (this *PacketClientTeams)

func NewPacketClientTeamsPlayersAdd

func NewPacketClientTeamsPlayersAdd(name string, players []string) (this *PacketClientTeams)

func NewPacketClientTeamsPlayersRemove

func NewPacketClientTeamsPlayersRemove(name string, players []string) (this *PacketClientTeams)

func NewPacketClientTeamsRemove

func NewPacketClientTeamsRemove(name string) (this *PacketClientTeams)

func (*PacketClientTeams) Id

func (this *PacketClientTeams) Id() int

type PacketGeneric

type PacketGeneric struct {
	Bytes []byte
	// contains filtered or unexported fields
}

func NewPacketGeneric

func NewPacketGeneric(id int, bytes []byte) (this *PacketGeneric)

func (*PacketGeneric) Id

func (this *PacketGeneric) Id() int

func (*PacketGeneric) SwapEntities

func (this *PacketGeneric) SwapEntities(a int32, b int32, clientServer bool)

func (*PacketGeneric) SwapEntitiesInt

func (this *PacketGeneric) SwapEntitiesInt(a int32, b int32, clientServer bool)

func (*PacketGeneric) SwapEntitiesVarInt

func (this *PacketGeneric) SwapEntitiesVarInt(a int32, b int32, clientServer bool)

type PacketServerClientSettings

type PacketServerClientSettings struct {
	Locale       string
	ViewDistance byte
	ChatFlags    byte
	ChatColours  bool
	ShowCape     bool
}

func NewPacketServerClientSettings

func NewPacketServerClientSettings(locale string, viewDistance byte, chatFlags byte, chatColours bool, showCape bool) (this *PacketServerClientSettings)

func (*PacketServerClientSettings) Id

func (this *PacketServerClientSettings) Id() int

type PacketServerHandshake

type PacketServerHandshake struct {
	ProtocolVersion int
	ServerAddress   string
	ServerPort      uint16
	State           int
}

func NewPacketServerHandshake

func NewPacketServerHandshake(protocolVersion int, serverAddress string, serverPort uint16, state int) (this *PacketServerHandshake)

func (*PacketServerHandshake) Id

func (this *PacketServerHandshake) Id() int

type PacketServerLoginEncryptResponse

type PacketServerLoginEncryptResponse struct {
	SharedSecret []byte
	VerifyToken  []byte
}

func NewPacketServerLoginEncryptResponse

func NewPacketServerLoginEncryptResponse(sharedSecret []byte, verifyToken []byte) (this *PacketServerLoginEncryptResponse)

func (*PacketServerLoginEncryptResponse) Id

type PacketServerLoginStart

type PacketServerLoginStart struct {
	Name string
}

func NewPacketServerLoginStart

func NewPacketServerLoginStart(name string) (this *PacketServerLoginStart)

func (*PacketServerLoginStart) Id

func (this *PacketServerLoginStart) Id() int

type PacketServerPluginMessage

type PacketServerPluginMessage struct {
	Channel string
	Data    []byte
}

func NewPacketServerPluginMessage

func NewPacketServerPluginMessage(channel string, data []byte) (this *PacketServerPluginMessage)

func (*PacketServerPluginMessage) Id

func (this *PacketServerPluginMessage) Id() int

type PacketServerStatusPing

type PacketServerStatusPing struct {
	Time int64
}

func NewPacketServerStatusPing

func NewPacketServerStatusPing(time int64) (this *PacketServerStatusPing)

func (*PacketServerStatusPing) Id

func (this *PacketServerStatusPing) Id() int

type PacketServerStatusRequest

type PacketServerStatusRequest struct {
}

func NewPacketServerStatusRequest

func NewPacketServerStatusRequest() (this *PacketServerStatusRequest)

func (*PacketServerStatusRequest) Id

func (this *PacketServerStatusRequest) Id() int

Jump to

Keyboard shortcuts

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