play

package
v0.0.0-...-f33b5a6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnimationSwingMainHand = byte(iota)
	AnimationTakeDamage
	AnimationLeaveBed
	AnimationSwingOffhand
	AnimationCriticalEffect
	AnimationMagicCriticalEffect
	AnimationNone
)
View Source
const (
	EquipmentMainHand = int32(iota)
	EquipmentOffHand
	EquipmentBoots
	EquipmentLeggings
	EquipmentChestplate
	EquipmentHelmet
)
View Source
const (
	ChatBox       = 0
	SystemMessage = 1
	GameInfo      = 2
)
View Source
const (
	PlayerPositionXRelative     = 0x01
	PlayerPositionYRelative     = 0x02
	PlayerPositionZRelative     = 0x04
	PlayerPositionYawRelative   = 0x08
	PlayerPositionPitchRelative = 0x10
)
View Source
const (
	// TODO: add from https://wiki.vg/Protocol#Effect
	EffectBlockBreak = int32(2001)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockBreakAnimation

type BlockBreakAnimation struct {
	EntityId     int32
	Location     minecraft.Position
	DestroyStage byte
}

func (BlockBreakAnimation) Encode

func (r BlockBreakAnimation) Encode(writer *minecraft.Writer)

type BlockChange

type BlockChange struct {
	Location minecraft.Position
	BlockID  uint16
}

func (BlockChange) Encode

func (r BlockChange) Encode(writer *minecraft.Writer)

type BlockRecord

type BlockRecord struct {
	BlockX     byte
	BlockZ     byte
	BlockY     byte
	BlockState uint16
}

type ChatMessage

type ChatMessage struct {
	Data     minecraft.Chat
	Position byte
}

func (ChatMessage) Encode

func (r ChatMessage) Encode(writer *minecraft.Writer)

type DestroyEntities

type DestroyEntities struct {
	EntityIDs []int32
}

func (DestroyEntities) Encode

func (r DestroyEntities) Encode(writer *minecraft.Writer)

type Disconnect

type Disconnect struct {
	Reason minecraft.Chat
}

func (Disconnect) Encode

func (r Disconnect) Encode(writer *minecraft.Writer)

type Effect

type Effect struct {
	EffectID              int32
	Location              minecraft.Position
	Data                  int32
	DisableRelativeVolume bool
}

func (Effect) Encode

func (r Effect) Encode(writer *minecraft.Writer)

type EntityAnimation

type EntityAnimation struct {
	EntityID  int32
	Animation byte
}

func (EntityAnimation) Encode

func (r EntityAnimation) Encode(writer *minecraft.Writer)

type EntityEquipment

type EntityEquipment struct {
	EntityID int32
	Slot     int32
	Item     *Slot
}

func (EntityEquipment) Encode

func (r EntityEquipment) Encode(writer *minecraft.Writer)

type EntityHeadLook

type EntityHeadLook struct {
	EntityID int32
	HeadYaw  minecraft.Angle
}

func (EntityHeadLook) Encode

func (r EntityHeadLook) Encode(writer *minecraft.Writer)

type EntityMetadata

type EntityMetadata struct {
	EntityID int32
	Metadata IMetadata
}

func (EntityMetadata) Encode

func (r EntityMetadata) Encode(writer *minecraft.Writer)

type EntityMovement

type EntityMovement struct {
	EntityID int32
}

func (EntityMovement) Encode

func (r EntityMovement) Encode(writer *minecraft.Writer)

type EntityPosition

type EntityPosition struct {
	EntityId int32
	DeltaX   int16
	DeltaY   int16
	DeltaZ   int16
	OnGround bool
}

func (EntityPosition) Encode

func (r EntityPosition) Encode(writer *minecraft.Writer)

type EntityPositionAndRotation

type EntityPositionAndRotation struct {
	EntityId int32
	DeltaX   int16
	DeltaY   int16
	DeltaZ   int16
	Yaw      minecraft.Angle
	Pitch    minecraft.Angle
	OnGround bool
}

func (EntityPositionAndRotation) Encode

func (r EntityPositionAndRotation) Encode(writer *minecraft.Writer)

type EntityRotation

type EntityRotation struct {
	EntityID int32
	Yaw      minecraft.Angle
	Pitch    minecraft.Angle
	OnGround bool
}

func (EntityRotation) Encode

func (r EntityRotation) Encode(writer *minecraft.Writer)

type EntityTeleport

type EntityTeleport struct {
	EntityID int32
	X        float64
	Y        float64
	Z        float64
	Yaw      minecraft.Angle
	Pitch    minecraft.Angle
	OnGround bool
}

func (EntityTeleport) Encode

func (r EntityTeleport) Encode(writer *minecraft.Writer)

type IMetadata

type IMetadata interface {
	WriteMetadata(writer *minecraft.EntityMetadataWriter)
}

type JoinGame

type JoinGame struct {
	EntityId            int32
	Gamemode            byte
	Dimension           int32
	HashedSeed          int64
	LevelType           string
	ViewDistance        int32
	ReducedDebugInfo    bool
	EnableRespawnScreen bool
}

func (JoinGame) Encode

func (r JoinGame) Encode(writer *minecraft.Writer)

type KeepAlive

type KeepAlive struct {
	KeepAliveId int64
}

func (KeepAlive) Encode

func (r KeepAlive) Encode(writer *minecraft.Writer)

type MultiBlockChange

type MultiBlockChange struct {
	ChunkX  int32
	ChunkZ  int32
	Records []BlockRecord
}

func (MultiBlockChange) Encode

func (r MultiBlockChange) Encode(writer *minecraft.Writer)

type PIAddPlayer

type PIAddPlayer struct {
	UUID uuid.UUID
	Name string
	//Props				[]mojang.PlayerProperty
	Gamemode    int32
	Ping        int32
	DisplayName *minecraft.Chat
}

func (PIAddPlayer) Encode

func (p PIAddPlayer) Encode(writer *minecraft.Writer)

type PIDisplayName

type PIDisplayName struct {
	UUID        uuid.UUID
	DisplayName *minecraft.Chat
}

func (PIDisplayName) Encode

func (p PIDisplayName) Encode(writer *minecraft.Writer)

type PIRemovePlayer

type PIRemovePlayer struct {
	UUID uuid.UUID
}

func (PIRemovePlayer) Encode

func (p PIRemovePlayer) Encode(writer *minecraft.Writer)

type PIUpdateGamemode

type PIUpdateGamemode struct {
	UUID     uuid.UUID
	Gamemode int32
}

func (PIUpdateGamemode) Encode

func (p PIUpdateGamemode) Encode(writer *minecraft.Writer)

type PIUpdateLatency

type PIUpdateLatency struct {
	UUID uuid.UUID
	Ping int32
}

func (PIUpdateLatency) Encode

func (p PIUpdateLatency) Encode(writer *minecraft.Writer)

type PlayerInfo

type PlayerInfo struct {
	AddPlayer         []PIAddPlayer
	UpdateGamemode    []PIUpdateGamemode
	UpdateLatency     []PIUpdateLatency
	UpdateDisplayName []PIDisplayName
	RemovePlayer      []PIRemovePlayer
}

func (PlayerInfo) Encode

func (p PlayerInfo) Encode(writer *minecraft.Writer)

type PlayerPositionAndLook

type PlayerPositionAndLook struct {
	X, Y, Z    float64
	Yaw, Pitch float32
	Flags      byte
	TeleportId int32
}

func (PlayerPositionAndLook) Encode

func (r PlayerPositionAndLook) Encode(writer *minecraft.Writer)

type SetSlot

type SetSlot struct {
	WindowID int8
	Slot     int16
	SlotData *Slot
}

func (SetSlot) Encode

func (s SetSlot) Encode(writer *minecraft.Writer)

type Slot

type Slot struct {
	ItemID    int32
	ItemCount byte
	NBT       interface{}
}

func (*Slot) CreateFake

func (s *Slot) CreateFake() *Slot

func (*Slot) Encode

func (s *Slot) Encode(writer *minecraft.Writer)

func (*Slot) String

func (s *Slot) String() string

type SpawnPlayer

type SpawnPlayer struct {
	EntityID int32
	UUID     uuid.UUID
	X        float64
	Y        float64
	Z        float64
	Yaw      minecraft.Angle
	Pitch    minecraft.Angle
}

func (SpawnPlayer) Encode

func (r SpawnPlayer) Encode(writer *minecraft.Writer)

type TimeUpdate

type TimeUpdate struct {
	WorldAge  int64
	TimeOfDay int64
}

func (TimeUpdate) Encode

func (p TimeUpdate) Encode(writer *minecraft.Writer)

type UnloadChunk

type UnloadChunk struct {
	ChunkX int32
	ChunkZ int32
}

func (UnloadChunk) Encode

func (p UnloadChunk) Encode(writer *minecraft.Writer)

type UpdateViewPosition

type UpdateViewPosition struct {
	ChunkX int32
	ChunkZ int32
}

func (UpdateViewPosition) Encode

func (p UpdateViewPosition) Encode(writer *minecraft.Writer)

Jump to

Keyboard shortcuts

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