bedrock

package
v0.0.0-...-b9cfb1f Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SwingArm     = 1
	StopSleeping = 3
	CriticalHit  = 4
)
View Source
const (
	RightClick   = 1
	LeftClick    = 2
	LeaveCehicle = 3
	MouseOver    = 4
)
View Source
const (
	Normal = iota + 0
	Mismatch
	UseItem
	UseItemOnEntity
	ReleaseItem
)

Transaction Types

View Source
const (
	ItemClickBlock = iota + 0
	ItemClickAir
	ItemBreakBlock

	//CONSUMABLE ITEMS
	ItemRelease = iota + 0
	ItemConsume
)

Action Types

View Source
const (
	ItemOnEntityInteract = iota + 0
	ItemOnEntityAttack
)

Entity Action types

View Source
const (
	PlayerStartBreak = iota
	PlayerAbortBreak
	PlayerStopBreak
	PlayerGetUpdatedBlock
	PlayerDropItem

	PlayerStopSleeping
	PlayerRespawn
	PlayerJump
	PlayerStartSprint
	PlayerStopSprint
	PlayerStartSneak
	PlayerStopSneak
	PlayerDimensionChangeRequest
	PlayerDimensionChangeAck
	PlayerStartGlide
	PlayerStopGlide
	PlayerBuildDenied
	PlayerContinueBreak
)
View Source
const (
	GameBroadcastSettingNone = iota
	GameBroadcastSettingInviteOnly
	GameBroadcastSettingFriendsOnly
	GameBroadcastSettingFriendsOfFriends
	GameBroadcastSettingPublic
)
View Source
const (
	DataLayerNormal = iota
	DataLayerLiquid
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEntityPacket

type AddEntityPacket struct {
	*packets.Packet
	UniqueId   int64
	RuntimeId  uint64
	EntityType uint32
	Position   r3.Vector
	Motion     r3.Vector
	Rotation   data.Rotation

	Attributes data.AttributeMap
	EntityData map[uint32][]interface{}
}

func NewAddEntityPacket

func NewAddEntityPacket() *AddEntityPacket

func (*AddEntityPacket) Decode

func (pk *AddEntityPacket) Decode()

func (*AddEntityPacket) Encode

func (pk *AddEntityPacket) Encode()

type AddPlayerPacket

type AddPlayerPacket struct {
	*packets.Packet
	UUID            uuid.UUID
	Username        string
	PlatformChatId  string
	EntityUniqueId  int64
	EntityRuntimeId uint64
	Position        r3.Vector
	Motion          r3.Vector
	Rotation        data.Rotation
	// HandItem TODO: Items.
	Metadata          map[uint32][]interface{}
	Flags             uint32
	CommandPermission uint32
	Flags2            uint32
	PlayerPermission  uint32
	CustomFlags       uint32
	Long1             int64
	// EntityLinks TODO
	DeviceID string
}

func NewAddPlayerPacket

func NewAddPlayerPacket() *AddPlayerPacket

func (*AddPlayerPacket) Decode

func (pk *AddPlayerPacket) Decode()

func (*AddPlayerPacket) Encode

func (pk *AddPlayerPacket) Encode()

type AnimatePacket

type AnimatePacket struct {
	*packets.Packet
	Action    int32
	RuntimeId uint64
	Float     float32
}

func NewAnimatePacket

func NewAnimatePacket() *AnimatePacket

func (*AnimatePacket) Decode

func (pk *AnimatePacket) Decode()

func (*AnimatePacket) Encode

func (pk *AnimatePacket) Encode()

type ChunkRadiusUpdatedPacket

type ChunkRadiusUpdatedPacket struct {
	*packets.Packet
	Radius int32
}

func NewChunkRadiusUpdatedPacket

func NewChunkRadiusUpdatedPacket() *ChunkRadiusUpdatedPacket

func (*ChunkRadiusUpdatedPacket) Decode

func (pk *ChunkRadiusUpdatedPacket) Decode()

func (*ChunkRadiusUpdatedPacket) Encode

func (pk *ChunkRadiusUpdatedPacket) Encode()

type ClientHandshakePacket

type ClientHandshakePacket struct {
	*packets.Packet
}

func NewClientHandshakePacket

func NewClientHandshakePacket() *ClientHandshakePacket

func (*ClientHandshakePacket) Decode

func (pk *ClientHandshakePacket) Decode()

func (*ClientHandshakePacket) Encode

func (pk *ClientHandshakePacket) Encode()

type CommandRequestPacket

type CommandRequestPacket struct {
	*packets.Packet
	CommandText string
	Type        uint32
	UUID        uuid.UUID
	RequestId   string
	Internal    bool
}

func NewCommandRequestPacket

func NewCommandRequestPacket() *CommandRequestPacket

func (*CommandRequestPacket) Decode

func (pk *CommandRequestPacket) Decode()

func (*CommandRequestPacket) Encode

func (pk *CommandRequestPacket) Encode()

type CraftingDataPacket

type CraftingDataPacket struct {
	*packets.Packet
}

func NewCraftingDataPacket

func NewCraftingDataPacket() *CraftingDataPacket

func (*CraftingDataPacket) Decode

func (pk *CraftingDataPacket) Decode()

func (*CraftingDataPacket) Encode

func (pk *CraftingDataPacket) Encode()

type DisconnectPacket

type DisconnectPacket struct {
	*packets.Packet
	HideDisconnectionScreen bool
	Message                 string
}

func NewDisconnectPacket

func NewDisconnectPacket() *DisconnectPacket

func (*DisconnectPacket) Decode

func (pk *DisconnectPacket) Decode()

func (*DisconnectPacket) Encode

func (pk *DisconnectPacket) Encode()

type FullChunkDataPacket

type FullChunkDataPacket struct {
	*packets.Packet
	ChunkX    int32
	ChunkZ    int32
	ChunkData []byte
}

func NewFullChunkDataPacket

func NewFullChunkDataPacket() *FullChunkDataPacket

func (*FullChunkDataPacket) Decode

func (pk *FullChunkDataPacket) Decode()

func (*FullChunkDataPacket) Encode

func (pk *FullChunkDataPacket) Encode()

type InteractPacket

type InteractPacket struct {
	*packets.Packet
	Action    byte
	RuntimeId uint64
}

func NewInteractPacket

func NewInteractPacket() *InteractPacket

func (*InteractPacket) Decode

func (pk *InteractPacket) Decode()

func (*InteractPacket) Encode

func (pk *InteractPacket) Encode()

type InventoryTransactionPacket

type InventoryTransactionPacket struct {
	*packets.Packet
	ActionList                                  *io.InventoryActionIOList
	TransactionType, ActionType                 uint32
	Face, HotbarSlot                            int32
	ItemSlot                                    *items.Stack
	BlockPosition                               blocks.Position
	PlayerPosition, ClickPosition, HeadPosition r3.Vector
	RuntimeId                                   uint64
}

func NewInventoryTransactionPacket

func NewInventoryTransactionPacket() *InventoryTransactionPacket

func (*InventoryTransactionPacket) Decode

func (pk *InventoryTransactionPacket) Decode()

func (*InventoryTransactionPacket) Encode

func (pk *InventoryTransactionPacket) Encode()

type LoginPacket

type LoginPacket struct {
	*packets.Packet
	Username          string
	Protocol          int32
	ClientUUID        uuid.UUID
	ClientId          int
	ClientXUID        string
	IdentityPublicKey string
	ServerAddress     string
	Language          string

	SkinId       string
	SkinData     []byte
	CapeData     []byte
	GeometryName string
	GeometryData string

	ClientData types.ClientDataKeys
	Chains     []types.Chain
}

func NewLoginPacket

func NewLoginPacket() *LoginPacket

func (*LoginPacket) BuildChain

func (pk *LoginPacket) BuildChain(raw string) types.Chain

func (*LoginPacket) Decode

func (pk *LoginPacket) Decode()

func (*LoginPacket) Encode

func (pk *LoginPacket) Encode()

type MoveEntityPacket

type MoveEntityPacket struct {
	*packets.Packet
	RuntimeId uint64
	Position  r3.Vector
	Rotation  data2.Rotation
	Flags     byte
}

func NewMoveEntityPacket

func NewMoveEntityPacket() *MoveEntityPacket

func (*MoveEntityPacket) Decode

func (pk *MoveEntityPacket) Decode()

func (*MoveEntityPacket) Encode

func (pk *MoveEntityPacket) Encode()

type MovePlayerPacket

type MovePlayerPacket struct {
	*packets.Packet
	RuntimeId                   uint64
	Position                    r3.Vector
	Rotation                    data2.Rotation
	Mode                        byte
	OnGround                    bool
	RidingRuntimeId             uint64
	TeleportCause, TeleportItem int32
}

func NewMovePlayerPacket

func NewMovePlayerPacket() *MovePlayerPacket

func (*MovePlayerPacket) Decode

func (pk *MovePlayerPacket) Decode()

func (*MovePlayerPacket) Encode

func (pk *MovePlayerPacket) Encode()

type NetworkChunkPublisherUpdatePacket

type NetworkChunkPublisherUpdatePacket struct {
	*packets.Packet
	Position blocks.Position
	Radius   uint32
}

func NewNetworkChunkPublisherUpdatePacket

func NewNetworkChunkPublisherUpdatePacket() *NetworkChunkPublisherUpdatePacket

func (*NetworkChunkPublisherUpdatePacket) Decode

func (pk *NetworkChunkPublisherUpdatePacket) Decode()

func (*NetworkChunkPublisherUpdatePacket) Encode

func (pk *NetworkChunkPublisherUpdatePacket) Encode()

type PlayStatusPacket

type PlayStatusPacket struct {
	*packets.Packet
	Status int32
}

func NewPlayStatusPacket

func NewPlayStatusPacket() *PlayStatusPacket

func (*PlayStatusPacket) Decode

func (pk *PlayStatusPacket) Decode()

func (*PlayStatusPacket) Encode

func (pk *PlayStatusPacket) Encode()

type PlayerActionPacket

type PlayerActionPacket struct {
	*packets.Packet
	RuntimeId uint64
	Action    int32
	Position  blocks.Position
	Face      int32
}

func NewPlayerActionPacket

func NewPlayerActionPacket() *PlayerActionPacket

func (*PlayerActionPacket) Decode

func (pk *PlayerActionPacket) Decode()

func (*PlayerActionPacket) Encode

func (pk *PlayerActionPacket) Encode()

type PlayerListPacket

type PlayerListPacket struct {
	*packets.Packet
	ListType byte
	Entries  map[string]types.PlayerListEntry
}

func NewPlayerListPacket

func NewPlayerListPacket() *PlayerListPacket

func (*PlayerListPacket) Decode

func (pk *PlayerListPacket) Decode()

func (*PlayerListPacket) Encode

func (pk *PlayerListPacket) Encode()

type PlayerSkinPacket

type PlayerSkinPacket struct {
	*packets.Packet

	UUID        uuid.UUID
	SkinId      string
	NewSkinName string
	OldSkinName string

	SkinData     []byte
	CapeData     []byte
	GeometryName string
	GeometryData string

	PremiumSkin bool
}

func NewPlayerSkinPacket

func NewPlayerSkinPacket() *PlayerSkinPacket

func (*PlayerSkinPacket) Decode

func (pk *PlayerSkinPacket) Decode()

func (*PlayerSkinPacket) Encode

func (pk *PlayerSkinPacket) Encode()

type RemoveEntityPacket

type RemoveEntityPacket struct {
	*packets.Packet
	EntityUniqueId int64
}

func NewRemoveEntityPacket

func NewRemoveEntityPacket() *RemoveEntityPacket

func (*RemoveEntityPacket) Decode

func (pk *RemoveEntityPacket) Decode()

func (*RemoveEntityPacket) Encode

func (pk *RemoveEntityPacket) Encode()

type RequestChunkRadiusPacket

type RequestChunkRadiusPacket struct {
	*packets.Packet
	Radius int32
}

func NewRequestChunkRadiusPacket

func NewRequestChunkRadiusPacket() *RequestChunkRadiusPacket

func (*RequestChunkRadiusPacket) Decode

func (pk *RequestChunkRadiusPacket) Decode()

func (*RequestChunkRadiusPacket) Encode

func (pk *RequestChunkRadiusPacket) Encode()

type ResourcePackChunkDataPacket

type ResourcePackChunkDataPacket struct {
	*packets.Packet
	PackUUID   string
	ChunkIndex int32
	Progress   int64
	ChunkData  []byte
}

func NewResourcePackChunkDataPacket

func NewResourcePackChunkDataPacket() *ResourcePackChunkDataPacket

func (*ResourcePackChunkDataPacket) Decode

func (pk *ResourcePackChunkDataPacket) Decode()

func (*ResourcePackChunkDataPacket) Encode

func (pk *ResourcePackChunkDataPacket) Encode()

type ResourcePackChunkRequestPacket

type ResourcePackChunkRequestPacket struct {
	*packets.Packet
	PackUUID   string
	ChunkIndex int32
}

func NewResourcePackChunkRequestPacket

func NewResourcePackChunkRequestPacket() *ResourcePackChunkRequestPacket

func (*ResourcePackChunkRequestPacket) Decode

func (pk *ResourcePackChunkRequestPacket) Decode()

func (*ResourcePackChunkRequestPacket) Encode

func (pk *ResourcePackChunkRequestPacket) Encode()

type ResourcePackClientResponsePacket

type ResourcePackClientResponsePacket struct {
	*packets.Packet
	Status    byte
	PackUUIDs []string
}

func NewResourcePackClientResponsePacket

func NewResourcePackClientResponsePacket() *ResourcePackClientResponsePacket

func (*ResourcePackClientResponsePacket) Decode

func (pk *ResourcePackClientResponsePacket) Decode()

func (*ResourcePackClientResponsePacket) Encode

func (pk *ResourcePackClientResponsePacket) Encode()

type ResourcePackDataInfoPacket

type ResourcePackDataInfoPacket struct {
	*packets.Packet
	PackUUID           string
	MaxChunkSize       int32
	ChunkCount         int32
	CompressedPackSize int64
	Sha256             string
}

func NewResourcePackDataInfoPacket

func NewResourcePackDataInfoPacket() *ResourcePackDataInfoPacket

func (*ResourcePackDataInfoPacket) Decode

func (pk *ResourcePackDataInfoPacket) Decode()

func (*ResourcePackDataInfoPacket) Encode

func (pk *ResourcePackDataInfoPacket) Encode()

type ResourcePackInfoPacket

type ResourcePackInfoPacket struct {
	*packets.Packet
	MustAccept    bool
	BehaviorPacks []types.ResourcePackInfoEntry
	ResourcePacks []types.ResourcePackInfoEntry
	Bool1         bool
}

func NewResourcePackInfoPacket

func NewResourcePackInfoPacket() *ResourcePackInfoPacket

func (*ResourcePackInfoPacket) Decode

func (pk *ResourcePackInfoPacket) Decode()

func (*ResourcePackInfoPacket) Encode

func (pk *ResourcePackInfoPacket) Encode()

type ResourcePackStackPacket

type ResourcePackStackPacket struct {
	*packets.Packet
	MustAccept    bool
	BehaviorPacks []types.ResourcePackStackEntry
	ResourcePacks []types.ResourcePackStackEntry
	Experimental  bool
}

func NewResourcePackStackPacket

func NewResourcePackStackPacket() *ResourcePackStackPacket

func (*ResourcePackStackPacket) Decode

func (pk *ResourcePackStackPacket) Decode()

func (*ResourcePackStackPacket) Encode

func (pk *ResourcePackStackPacket) Encode()

type ServerHandshakePacket

type ServerHandshakePacket struct {
	*packets.Packet
	Jwt string
}

func NewServerHandshakePacket

func NewServerHandshakePacket() *ServerHandshakePacket

func (*ServerHandshakePacket) Decode

func (pk *ServerHandshakePacket) Decode()

func (*ServerHandshakePacket) Encode

func (pk *ServerHandshakePacket) Encode()

type SetEntityDataPacket

type SetEntityDataPacket struct {
	*packets.Packet
	RuntimeId  uint64
	EntityData map[uint32][]interface{}
}

func NewSetEntityDataPacket

func NewSetEntityDataPacket() *SetEntityDataPacket

func (*SetEntityDataPacket) Decode

func (pk *SetEntityDataPacket) Decode()

func (*SetEntityDataPacket) Encode

func (pk *SetEntityDataPacket) Encode()

type StartGamePacket

type StartGamePacket struct {
	*packets.Packet
	EntityUniqueId            int64
	EntityRuntimeId           uint64
	PlayerGameMode            int32
	PlayerPosition            r3.Vector
	Yaw                       float32
	Pitch                     float32
	LevelSeed                 int32
	Dimension                 int32
	Generator                 int32
	LevelGameMode             int32
	Difficulty                int32
	LevelSpawnPosition        blocks.Position
	AchievementsDisabled      bool
	Time                      int32
	EduMode                   bool
	EduFeaturesEnabled        bool
	RainLevel                 float32
	LightningLevel            float32
	Bool1                     bool
	MultiPlayerGame           bool
	BroadcastToLan            bool
	CommandsEnabled           bool
	ForcedResourcePacks       bool
	GameRules                 map[string]types.GameRuleEntry
	BonusChest                bool
	StartMap                  bool
	DefaultPermissionLevel    int32
	LevelName                 string
	IsTrial                   bool
	CurrentTick               int64
	EnchantmentSeed           int32
	ServerChunkTickRange      int32
	PlatformBroadcast         bool
	XBOXBroadcastIntent       int32
	PlatformBroadcastIntent   int32
	LockedBehaviorPack        bool
	LockedResourcePack        bool
	FromLockedWorldTemplate   bool
	UseMsaGamertagsOnly       bool
	FromWorldTemplate         bool
	WorldTemplateOptionLocked bool
	RuntimeIdsTable           []byte
	MultiplayerCorrelationID  string
}

func NewStartGamePacket

func NewStartGamePacket() *StartGamePacket

func (*StartGamePacket) Decode

func (pk *StartGamePacket) Decode()

func (*StartGamePacket) Encode

func (pk *StartGamePacket) Encode()

type TextPacket

type TextPacket struct {
	*packets.Packet
	TextType       byte
	Translation    bool
	SourceName     string
	Message        string
	XUID           string
	PlatformChatId string

	Params []string
}

func NewTextPacket

func NewTextPacket() *TextPacket

func (*TextPacket) Decode

func (pk *TextPacket) Decode()

func (*TextPacket) Encode

func (pk *TextPacket) Encode()

type TransferPacket

type TransferPacket struct {
	*packets.Packet
	Address string
	Port    uint16
}

func NewTransferPacket

func NewTransferPacket() *TransferPacket

func (*TransferPacket) Decode

func (pk *TransferPacket) Decode()

func (*TransferPacket) Encode

func (pk *TransferPacket) Encode()

type UpdateAttributesPacket

type UpdateAttributesPacket struct {
	*packets.Packet
	RuntimeId  uint64
	Attributes data.AttributeMap
}

func NewUpdateAttributesPacket

func NewUpdateAttributesPacket() *UpdateAttributesPacket

func (*UpdateAttributesPacket) Decode

func (pk *UpdateAttributesPacket) Decode()

func (*UpdateAttributesPacket) Encode

func (pk *UpdateAttributesPacket) Encode()

type UpdateBlockPacket

type UpdateBlockPacket struct {
	*packets.Packet
	Position       blocks.Position
	BlockRuntimeId uint32
	Flags          uint32
	DataLayerId    uint32
}

func NewUpdateBlockPacket

func NewUpdateBlockPacket() *UpdateBlockPacket

func (*UpdateBlockPacket) Decode

func (pk *UpdateBlockPacket) Decode()

func (*UpdateBlockPacket) Encode

func (pk *UpdateBlockPacket) Encode()

Jump to

Keyboard shortcuts

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