clientbound

package
v0.0.0-...-b730334 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MinecraftBiomeRegistry = BiomeRegistry{
	Type: "minecraft:worldgen/biome",
	Value: []BiomeRegistryEntry{
		MinecraftPlains,
	},
}
View Source
var MinecraftDimensionTypeRegistry = DimensionTypeRegistry{
	Type: "minecraft:dimension_type",
	Value: []DimensionTypeRegistryEntry{
		{
			Name:    "minecraft:overworld",
			ID:      0,
			Element: MinecraftOverworld,
		},
	},
}
View Source
var MinecraftOverworld = DimensionType{
	PiglinSafe:         0,
	Natural:            1,
	AmbientLight:       0.0,
	Infiniburn:         "minecraft:infiniburn_overworld",
	RespawnAnchorWorks: 0,
	HasSkylight:        1,
	BedWorks:           1,
	Effects:            "minecraft:overworld",
	HasRaids:           0,
	LogicalHeight:      256,
	CoordinateScale:    1.0,
	Ultrawarm:          0,
	HasCeiling:         0,
}
View Source
var MinecraftPlains = BiomeRegistryEntry{
	Name: "minecraft:plains",
	ID:   0,
	Element: BiomeProperties{
		Precipitation: "none",
		Depth:         0.125,
		Temperature:   0.8,
		Scale:         0.05,
		Downfall:      0.4,
		Category:      "plains",
		Effects: BiomeEffects{
			SkyColor:      7907327,
			WaterFogColor: 329011,
			FogColor:      12638463,
			WaterColor:    4159204,
		},
	},
}

Functions

This section is empty.

Types

type BiomeEffects

type BiomeEffects struct {
	SkyColor      int32 `nbt:"sky_color"`
	WaterFogColor int32 `nbt:"water_fog_color"`
	FogColor      int32 `nbt:"fog_color"`
	WaterColor    int32 `nbt:"water_color"`
}

type BiomeProperties

type BiomeProperties struct {
	Precipitation string       `nbt:"precipitation"`
	Depth         float32      `nbt:"depth"`
	Temperature   float32      `nbt:"temperature"`
	Scale         float32      `nbt:"scale"`
	Downfall      float32      `nbt:"downfall"`
	Category      string       `nbt:"category"`
	Effects       BiomeEffects `nbt:"effects"`
}

type BiomeRegistry

type BiomeRegistry struct {
	Type  string               `nbt:"type"`
	Value []BiomeRegistryEntry `nbt:"value"`
}

type BiomeRegistryEntry

type BiomeRegistryEntry struct {
	Name    string          `nbt:"name"`
	ID      int32           `nbt:"id"`
	Element BiomeProperties `nbt:"element"`
}

type BiomesArray

type BiomesArray []pk.VarInt

func (BiomesArray) Encode

func (a BiomesArray) Encode() []byte

type BlockChange

type BlockChange struct {
	Location pk.Position
	BlockID  pk.VarInt
}

func (BlockChange) CreatePacket

func (p BlockChange) CreatePacket() pk.Packet

type BlockEntities

type BlockEntities []pk.NBT

func (BlockEntities) Encode

func (a BlockEntities) Encode() []byte

type BlockLight

type BlockLight struct {
	Arrays []pk.ByteArray
}

func (BlockLight) Encode

func (s BlockLight) Encode() []byte

type ChatMessage

type ChatMessage struct {
	JSONData pk.Chat
	Position pk.Byte
	Sender   pk.UUID
}

func (ChatMessage) CreatePacket

func (p ChatMessage) CreatePacket() pk.Packet

type ChunkData

type ChunkData struct {
	ChunkX           pk.Int
	ChunkZ           pk.Int
	FullChunk        pk.Boolean
	PrimaryBitMask   pk.VarInt
	Heightmaps       pk.NBT
	BiomesLength     pk.VarInt   // Optional, not present if full chunk is false
	Biomes           BiomesArray // Optional, not present if full chunk is false
	Size             pk.VarInt
	Data             ChunkDataArray
	NumBlockEntities pk.VarInt
	BlockEntities    BlockEntities
}

func (ChunkData) CreatePacket

func (s ChunkData) CreatePacket() pk.Packet

type ChunkDataArray

type ChunkDataArray []ChunkSection

func (ChunkDataArray) Encode

func (a ChunkDataArray) Encode() []byte

type ChunkPalette

type ChunkPalette struct {
	Length  pk.VarInt
	Palette []pk.VarInt
}

func (ChunkPalette) Encode

func (s ChunkPalette) Encode() []byte

type ChunkSection

type ChunkSection struct {
	BlockCount      pk.Short
	BitsPerBlock    pk.UByte
	Palette         ChunkPalette
	DataArrayLength pk.VarInt
	DataArray       []pk.Long
}

func (ChunkSection) Encode

func (s ChunkSection) Encode() []byte

type CombatEvent

type CombatEvent struct {
	PlayerID pk.VarInt
	EntityID pk.Int
	Message  pk.Chat
}

https://wiki.vg/Protocol#Combat_Event Since only entity dead event is used, other fields are ignored and assumed

func (CombatEvent) CreatePacket

func (s CombatEvent) CreatePacket() pk.Packet

type DeclareRecipes

type DeclareRecipes struct {
	NumRecipes pk.VarInt
	Recipes    recipes
}

func (DeclareRecipes) CreatePacket

func (s DeclareRecipes) CreatePacket() pk.Packet

type DestroyEntities

type DestroyEntities struct {
	Count     pk.VarInt
	EntityIDs ids
}

func (DestroyEntities) CreatePacket

func (s DestroyEntities) CreatePacket() pk.Packet

type DimensionCodec

type DimensionCodec struct {
	DimensionTypes DimensionTypeRegistry `nbt:"minecraft:dimension_type"`
	BiomeRegistry  BiomeRegistry         `nbt:"minecraft:worldgen/biome"`
}

type DimensionType

type DimensionType struct {
	PiglinSafe         byte    `nbt:"piglin_safe"`
	Natural            byte    `nbt:"natural"`
	AmbientLight       float32 `nbt:"ambient_light"`
	Infiniburn         string  `nbt:"infiniburn"`
	RespawnAnchorWorks byte    `nbt:"respawn_anchor_works"`
	HasSkylight        byte    `nbt:"has_skylight"`
	BedWorks           byte    `nbt:"bed_works"`
	Effects            string  `nbt:"effects"`
	HasRaids           byte    `nbt:"has_raids"`
	LogicalHeight      int32   `nbt:"logical_height"`
	CoordinateScale    float32 `nbt:"coordinate_scale"`
	Ultrawarm          byte    `nbt:"ultrawarm"`
	HasCeiling         byte    `nbt:"has_ceiling"`
}

type DimensionTypeRegistry

type DimensionTypeRegistry struct {
	Type  string                       `nbt:"type"`
	Value []DimensionTypeRegistryEntry `nbt:"value"`
}

type DimensionTypeRegistryEntry

type DimensionTypeRegistryEntry struct {
	Name    string        `nbt:"name"`
	ID      int32         `nbt:"id"`
	Element DimensionType `nbt:"element"`
}

type EntityAnimation

type EntityAnimation struct {
	EntityID  pk.VarInt
	Animation pk.UByte
}

func (EntityAnimation) CreatePacket

func (s EntityAnimation) CreatePacket() pk.Packet

type EntityHeadLook

type EntityHeadLook struct {
	EntityID pk.VarInt
	HeadYaw  pk.Angle
}

func (EntityHeadLook) CreatePacket

func (s EntityHeadLook) CreatePacket() pk.Packet

type EntityMetadata

type EntityMetadata struct {
	EntityID pk.VarInt
	Metadata metadataArray
}

func (EntityMetadata) CreatePacket

func (s EntityMetadata) CreatePacket() pk.Packet

type EntityPosition

type EntityPosition struct {
	EntityID pk.VarInt
	DeltaX   pk.Short
	DeltaY   pk.Short
	DeltaZ   pk.Short
	OnGround pk.Boolean
}

func (EntityPosition) CreatePacket

func (s EntityPosition) CreatePacket() pk.Packet

type EntityPositionAndRotation

type EntityPositionAndRotation struct {
	EntityID pk.VarInt
	DeltaX   pk.Short
	DeltaY   pk.Short
	DeltaZ   pk.Short
	Yaw      pk.Angle
	Pitch    pk.Angle
	OnGround pk.Boolean
}

func (EntityPositionAndRotation) CreatePacket

func (s EntityPositionAndRotation) CreatePacket() pk.Packet

type EntityRotation

type EntityRotation struct {
	EntityID pk.VarInt
	Yaw      pk.Angle
	Pitch    pk.Angle
	OnGround pk.Boolean
}

func (EntityRotation) CreatePacket

func (s EntityRotation) CreatePacket() pk.Packet

type EntityStatus

type EntityStatus struct {
	EntityID     pk.Int
	EntityStatus pk.Byte
}

func (EntityStatus) CreatePacket

func (s EntityStatus) CreatePacket() pk.Packet

type Heightmap

type Heightmap struct {
	MotionBlocking []int64 `nbt:"MOTION_BLOCKING"`
}

type HeldItemChange

type HeldItemChange struct {
	Slot pk.Byte
}

func (HeldItemChange) CreatePacket

func (s HeldItemChange) CreatePacket() pk.Packet

type JoinGame

type JoinGame struct {
	EntityID       pk.Int
	IsHardcore     pk.Boolean
	Gamemode       pk.UByte
	PrevGamemode   pk.Byte
	WorldCount     pk.VarInt
	WorldNames     worldNames // Array of Identifiers
	DimensionCodec pk.NBT
	Dimension      pk.NBT
	WorldName      pk.Identifier
	HashedSeed     pk.Long
	MaxPlayers     pk.VarInt // Now ignored
	ViewDistance   pk.VarInt
	RDI            pk.Boolean // Reduced Debug Info
	ERS            pk.Boolean // Enable respawn screen
	IsDebug        pk.Boolean
	IsFlat         pk.Boolean
}

func (JoinGame) CreatePacket

func (s JoinGame) CreatePacket() pk.Packet

type KeepAlive

type KeepAlive struct {
	ID pk.Long
}

func (KeepAlive) CreatePacket

func (p KeepAlive) CreatePacket() pk.Packet

type MetadataField

type MetadataField struct {
	Index pk.UByte
	Type  pk.VarInt    // Optional, present if Index != 0xff
	Value pk.Encodable // Optional, present if Index != 0xff, type depends on Type
}

https://wiki.vg/Entity_metadata#Entity_Metadata_Format

func (MetadataField) Encode

func (s MetadataField) Encode() []byte

type NamedSoundEffect

type NamedSoundEffect struct {
	SoundName       pk.Identifier
	SoundCategory   pk.VarInt
	EffectPositionX pk.Int   // https://wiki.vg/Data_types#Fixed-point_numbers
	EffectPositionY pk.Int   // Fixed point with 3 bits for fractional part
	EffectPositionZ pk.Int   // Equal to EffectX multiplied by 8
	Volume          pk.Float // 1 is 100%, can be greater
	Pitch           pk.Float // Between 0.5 and 2.0 on Notchian clients
}

func (NamedSoundEffect) CreatePacket

func (s NamedSoundEffect) CreatePacket() pk.Packet

type PlayerInfo

type PlayerInfo struct {
	Action     pk.VarInt
	NumPlayers pk.VarInt
	Players    players
}

func (PlayerInfo) CreatePacket

func (s PlayerInfo) CreatePacket() pk.Packet

type PlayerInfoAddPlayer

type PlayerInfoAddPlayer struct {
	UUID           pk.UUID
	Name           pk.String // 16
	NumProperties  pk.VarInt
	Properties     Properties
	Gamemode       pk.VarInt
	Ping           pk.VarInt
	HasDisplayName pk.Boolean
	DisplayName    pk.Chat // Optional
}

func (PlayerInfoAddPlayer) Encode

func (s PlayerInfoAddPlayer) Encode() []byte

type PlayerInfoRemovePlayer

type PlayerInfoRemovePlayer struct {
	UUID pk.UUID
}

func (PlayerInfoRemovePlayer) Encode

func (s PlayerInfoRemovePlayer) Encode() []byte

type PlayerPositionAndLook

type PlayerPositionAndLook struct {
	X          pk.Double
	Y          pk.Double
	Z          pk.Double
	Yaw        pk.Float
	Pitch      pk.Float
	Flags      pk.Byte
	TeleportID pk.VarInt
}

func (PlayerPositionAndLook) CreatePacket

func (s PlayerPositionAndLook) CreatePacket() pk.Packet

type Properties

type Properties []Property

func (Properties) Encode

func (a Properties) Encode() []byte

type Property

type Property struct {
}

type Respawn

type Respawn struct {
	Dimension        pk.NBT
	WorldName        pk.Identifier
	HashedSeed       pk.Long
	Gamemode         pk.UByte
	PreviousGamemode pk.UByte
	IsDebug          pk.Boolean
	IsFlat           pk.Boolean
	CopyMetadata     pk.Boolean
}

func (Respawn) CreatePacket

func (s Respawn) CreatePacket() pk.Packet

type SetSlot

type SetSlot struct {
	WindowID pk.Byte
	Slot     pk.Short
	SlotData pk.Slot
}

func (SetSlot) CreatePacket

func (s SetSlot) CreatePacket() pk.Packet

type SkyLight

type SkyLight struct {
	Arrays []pk.ByteArray
}

func (SkyLight) Encode

func (s SkyLight) Encode() []byte

type SpawnEntity

type SpawnEntity struct {
	EntityID   pk.VarInt
	ObjectUUID pk.UUID
	Type       pk.VarInt
	X          pk.Double
	Y          pk.Double
	Z          pk.Double
	Pitch      pk.Angle
	Yaw        pk.Angle
	Data       pk.Int
	VelocityX  pk.Short
	VelocityY  pk.Short
	VelocityZ  pk.Short
}

func (SpawnEntity) CreatePacket

func (s SpawnEntity) CreatePacket() pk.Packet

type SpawnLivingEntity

type SpawnLivingEntity struct {
	EntityID   pk.VarInt
	EntityUUID pk.UUID
	Type       pk.VarInt
	X          pk.Double
	Y          pk.Double
	Z          pk.Double
	Yaw        pk.Angle
	Pitch      pk.Angle
	HeadPitch  pk.Angle
	VelocityX  pk.Short
	VelocityY  pk.Short
	VelocityZ  pk.Short
}

func (SpawnLivingEntity) CreatePacket

func (s SpawnLivingEntity) CreatePacket() pk.Packet

type SpawnPlayer

type SpawnPlayer struct {
	EntityID   pk.VarInt
	PlayerUUID pk.UUID
	X          pk.Double
	Y          pk.Double
	Z          pk.Double
	Yaw        pk.Angle
	Pitch      pk.Angle
}

func (SpawnPlayer) CreatePacket

func (s SpawnPlayer) CreatePacket() pk.Packet

type SpawnPosition

type SpawnPosition struct {
	Location pk.Position
}

func (SpawnPosition) CreatePacket

func (s SpawnPosition) CreatePacket() pk.Packet

type StatusPong

type StatusPong struct {
	Payload pk.Long
}

func (StatusPong) CreatePacket

func (p StatusPong) CreatePacket() pk.Packet

type StatusResponse

type StatusResponse struct {
	JSONResponse pk.String
}

func (StatusResponse) CreatePacket

func (p StatusResponse) CreatePacket() pk.Packet

type Tag

type Tag struct {
	TagName pk.Identifier
	Entries []pk.VarInt
}

func (Tag) Encode

func (s Tag) Encode() []byte

type Tags

type Tags struct {
	BlockTags  TagsArray
	ItemTags   TagsArray
	FluidTags  TagsArray
	EntityTags TagsArray
}

func VanillaTags

func VanillaTags() Tags

func (Tags) CreatePacket

func (s Tags) CreatePacket() pk.Packet

type TagsArray

type TagsArray []Tag

func (TagsArray) Encode

func (a TagsArray) Encode() []byte

type TimeUpdate

type TimeUpdate struct {
	WorldAge  pk.Long
	TimeOfDay pk.Long
}

func (TimeUpdate) CreatePacket

func (p TimeUpdate) CreatePacket() pk.Packet

type UnloadChunk

type UnloadChunk struct {
	ChunkX pk.Int
	ChunkZ pk.Int
}

func (UnloadChunk) CreatePacket

func (s UnloadChunk) CreatePacket() pk.Packet

type UpdateHealth

type UpdateHealth struct {
	Health         pk.Float
	Food           pk.VarInt
	FoodSaturation pk.Float
}

func (UpdateHealth) CreatePacket

func (s UpdateHealth) CreatePacket() pk.Packet

type UpdateLight

type UpdateLight struct {
	ChunkX              pk.VarInt
	ChunkZ              pk.VarInt
	TrustEdges          pk.Boolean
	SkyLightMask        pk.VarInt
	BlockLightMask      pk.VarInt
	EmptySkyLightMask   pk.VarInt
	EmptyBlockLightMask pk.VarInt
	SkyLightArrays      SkyLight
	BlockLightArrays    BlockLight
}

func (UpdateLight) CreatePacket

func (s UpdateLight) CreatePacket() pk.Packet

type UpdateViewPosition

type UpdateViewPosition struct {
	ChunkX pk.VarInt
	ChunkZ pk.VarInt
}

func (UpdateViewPosition) CreatePacket

func (s UpdateViewPosition) CreatePacket() pk.Packet

type WindowItems

type WindowItems struct {
	WindowID pk.UByte
	Count    pk.Short
	SlotData slotData
}

func (WindowItems) CreatePacket

func (s WindowItems) CreatePacket() pk.Packet

Jump to

Keyboard shortcuts

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