Documentation ¶
Overview ¶
Package ptypes implements encoding and decoding for high-level packets.
Package ptypes implements encoding and decoding for high-level packets.
Package ptypes implements encoding and decoding for high-level packets.
Index ¶
- type ChatMessageClientbound
- type ChunkData
- type ConfirmTransaction
- type EntityAnimationClientbound
- type EntityPosition
- type EntityPositionLook
- type EntityRotation
- type JoinGame
- type Look
- type NamedSoundEffect
- type OpenWindow
- type PluginData
- type PluginMessage
- type Position
- type PositionAndLookClientbound
- func (p *PositionAndLookClientbound) Decode(pkt pk.Packet) error
- func (p *PositionAndLookClientbound) RelativePitch() bool
- func (p *PositionAndLookClientbound) RelativeX() bool
- func (p *PositionAndLookClientbound) RelativeY() bool
- func (p *PositionAndLookClientbound) RelativeYaw() bool
- func (p *PositionAndLookClientbound) RelativeZ() bool
- type PositionAndLookServerbound
- type SetSlot
- type SoundEffect
- type SpawnEntity
- type SpawnLivingEntity
- type SpawnPlayer
- type TileEntityData
- type UpdateHealth
- type WindowItems
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatMessageClientbound ¶
ChatMessageClientbound represents a chat message forwarded by the server.
type ChunkData ¶
type ChunkData struct {
X, Z pk.Int
FullChunk pk.Boolean
PrimaryBitMask pk.VarInt
Heightmaps struct{}
Biomes biomesData
Data chunkData
BlockEntities blockEntities
}
ChunkData is a clientbound packet which describes a chunk.
type ConfirmTransaction ¶
func (ConfirmTransaction) Encode ¶
func (p ConfirmTransaction) Encode() pk.Packet
type EntityAnimationClientbound ¶
type EntityAnimationClientbound struct { ID pk.VarInt Animation pk.UnsignedByte }
EntityAnimationClientbound updates the animationf state of an entity.
type EntityPosition ¶
EntityPosition is a clientbound packet used to update an entities position.
type EntityPositionLook ¶
type EntityPositionLook struct { ID pk.VarInt X, Y, Z pk.Short // Deltas Yaw, Pitch pk.Angle OnGround pk.Boolean }
EntityPosition is a clientbound packet used to update an entities position and its rotation.
type EntityRotation ¶
EntityRotation is a clientbound packet used to update an entities rotation.
type JoinGame ¶
type JoinGame struct { PlayerEntity pk.Int Hardcore pk.Boolean Gamemode pk.UnsignedByte PrevGamemode pk.UnsignedByte WorldCount pk.VarInt WorldNames pk.Identifier //DimensionCodec pk.NBT Dimension pk.Int WorldName pk.Identifier HashedSeed pk.Long ViewDistance pk.VarInt RDI pk.Boolean // Reduced Debug Info ERS pk.Boolean // Enable respawn screen IsDebug pk.Boolean IsFlat pk.Boolean // contains filtered or unexported fields }
JoinGame encodes global/world information from the server.
type NamedSoundEffect ¶
type NamedSoundEffect struct { Sound pk.String Category pk.VarInt X, Y, Z pk.Int Volume, Pitch pk.Float }
NamedSoundEffect is a clientbound packet used to play a sound with the specified name on the client.
type OpenWindow ¶
OpenWindow is a clientbound packet which opens an inventory.
type PluginData ¶
type PluginData []byte
PluginData encodes the custom data encoded in a plugin message.
func (*PluginData) Decode ¶
func (p *PluginData) Decode(r pk.DecodeReader) error
func (PluginData) Encode ¶
func (p PluginData) Encode() []byte
type PluginMessage ¶
type PluginMessage struct { Channel pk.Identifier Data PluginData }
PluginMessage represents a packet with a customized payload.
func (*PluginMessage) Encode ¶
func (p *PluginMessage) Encode() pk.Packet
type PositionAndLookClientbound ¶
type PositionAndLookClientbound struct {
X, Y, Z pk.Double
Yaw, Pitch pk.Float
Flags pk.Byte
TeleportID pk.VarInt
}
PositionAndLookClientbound describes the location and orientation of the player.
func (*PositionAndLookClientbound) Decode ¶
func (p *PositionAndLookClientbound) Decode(pkt pk.Packet) error
func (*PositionAndLookClientbound) RelativePitch ¶
func (p *PositionAndLookClientbound) RelativePitch() bool
func (*PositionAndLookClientbound) RelativeX ¶
func (p *PositionAndLookClientbound) RelativeX() bool
func (*PositionAndLookClientbound) RelativeY ¶
func (p *PositionAndLookClientbound) RelativeY() bool
func (*PositionAndLookClientbound) RelativeYaw ¶
func (p *PositionAndLookClientbound) RelativeYaw() bool
func (*PositionAndLookClientbound) RelativeZ ¶
func (p *PositionAndLookClientbound) RelativeZ() bool
type PositionAndLookServerbound ¶
type PositionAndLookServerbound struct {
X, Y, Z pk.Double
Yaw, Pitch pk.Float
OnGround pk.Boolean
}
PositionAndLookServerbound describes the location and orientation of the player.
func (PositionAndLookServerbound) Encode ¶
func (p PositionAndLookServerbound) Encode() pk.Packet
type SetSlot ¶
SetSlot is a clientbound packet which configures an inventory slot. A window ID of -1 represents the cursor, and a window ID of 0 represents the players inventory.
type SoundEffect ¶
type SoundEffect struct { Sound pk.VarInt Category pk.VarInt X, Y, Z pk.Int Volume, Pitch pk.Float }
SoundEffect is a clientbound packet used to play a specific sound ID on the client.
type SpawnEntity ¶
type SpawnEntity struct { ID pk.VarInt UUID pk.UUID Type pk.VarInt X, Y, Z pk.Double Pitch, Yaw pk.Angle Data pk.Int VelX, VelY, VelZ pk.Short }
SpawnEntity is a clientbound packet used to spawn a non-mob entity.
type SpawnLivingEntity ¶
type SpawnLivingEntity struct { ID pk.VarInt UUID pk.UUID Type pk.VarInt X, Y, Z pk.Double Yaw, Pitch pk.Angle HeadPitch pk.Angle VelX, VelY, VelZ pk.Short }
SpawnLivingEntity is a clientbound packet used to spawn a mob.
type SpawnPlayer ¶
SpawnPlayer is a clientbound packet used to describe a player entering visible range.
type TileEntityData ¶
type TileEntityData struct { Pos pk.Position Action pk.UnsignedByte Data entity.BlockEntity }
TileEntityData describes a change to a tile entity.
type UpdateHealth ¶
UpdateHealth encodes player health/food information from the server.