packet

package
v0.0.0-...-2a33acd Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupPacketTypes

func SetupPacketTypes()

Types

type Clientbound

type Clientbound int32
const (
	// Special none type; used as a placeholder to when a packet is defined
	// in an older version, but not in the grpc version.
	Clientbound_None Clientbound = iota
	Clientbound_SpawnEntity
	Clientbound_SpawnExpOrb
	Clientbound_SpawnWeatherEntity
	Clientbound_SpawnLivingEntity
	Clientbound_SpawnPainting
	Clientbound_SpawnPlayer
	Clientbound_EntityAnimation
	Clientbound_Statistics
	Clientbound_AcknowledgePlayerDigging
	Clientbound_BlockBreakAnimation
	Clientbound_BlockEntityData
	Clientbound_BlockAction
	Clientbound_BlockChange
	Clientbound_BossBar
	Clientbound_ServerDifficulty
	Clientbound_ChatMessage
	Clientbound_MultiBlockChange
	Clientbound_TabComplete
	Clientbound_DeclareCommands
	Clientbound_WindowConfirm
	Clientbound_CloseWindow
	Clientbound_WindowItems
	Clientbound_WindowProperty
	Clientbound_SetSlot
	Clientbound_SetCooldown
	Clientbound_PluginMessage
	Clientbound_NamedSoundEffect
	Clientbound_Disconnect
	Clientbound_EntityStatus
	Clientbound_Explosion
	Clientbound_UnloadChunk
	Clientbound_ChangeGameState
	Clientbound_OpenHorseWindow
	Clientbound_KeepAlive
	Clientbound_ChunkData
	Clientbound_Effect
	Clientbound_Particle
	Clientbound_UpdateLight
	Clientbound_JoinGame
	Clientbound_MapData
	Clientbound_TradeList
	Clientbound_EntityPosition
	Clientbound_EntityPositionAndRotation
	Clientbound_EntityRotation
	Clientbound_EntityOnGround
	Clientbound_VehicleMove
	Clientbound_OpenBook
	Clientbound_OpenWindow
	Clientbound_OpenSignEditor
	Clientbound_CraftRecipeResponse
	Clientbound_PlayerAbilities
	Clientbound_EnterCombat
	Clientbound_PlayerInfo
	Clientbound_FacePlayer
	Clientbound_PlayerPositionAndLook
	Clientbound_UnlockRecipies
	Clientbound_DestroyEntity
	Clientbound_RemoveEntityEffect
	Clientbound_ResourcePack
	Clientbound_Respawn
	Clientbound_EntityHeadLook
	Clientbound_SelectAdvancementTab
	Clientbound_WorldBorder
	Clientbound_Camera
	Clientbound_HeldItemChange
	Clientbound_UpdateViewPosition
	Clientbound_UpdateViewDistance
	Clientbound_DisplayScoreboard
	Clientbound_EntityMetadata
	Clientbound_AttachEntity
	Clientbound_EntityVelocity
	Clientbound_EntityEquipment
	Clientbound_SetExp
	Clientbound_UpdateHealth
	Clientbound_ScoreboardObjective
	Clientbound_SetPassengers
	Clientbound_Teams
	Clientbound_UpdateScore
	Clientbound_SpawnPosition
	Clientbound_TimeUpdate
	Clientbound_Title
	Clientbound_EntitySoundEffect
	Clientbound_SoundEffect
	Clientbound_StopSound
	Clientbound_PlayerListHeader
	Clientbound_NBTQueryResponse
	Clientbound_CollectItem
	Clientbound_EntityTeleport
	Clientbound_Advancements
	Clientbound_EntityProperties
	Clientbound_EntityEffect
	Clientbound_DeclareRecipies
	Clientbound_Tags
	// Custom packet; should be intercepted by the proxy
	Clientbound_Login
)

func (Clientbound) String

func (c Clientbound) String() string

type ConnectionWithChan

type ConnectionWithChan struct {
	// contains filtered or unexported fields
}

func (*ConnectionWithChan) GetStream

func (*ConnectionWithChan) Listen

func (c *ConnectionWithChan) Listen()

type OutgoingPacket

type OutgoingPacket struct {
	// contains filtered or unexported fields
}

func NewOutgoingPacket

func NewOutgoingPacket(id Clientbound) *OutgoingPacket

func (*OutgoingPacket) AddEntityProperty

func (p *OutgoingPacket) AddEntityProperty(name string, val float64)

func (*OutgoingPacket) Send

func (p *OutgoingPacket) Send(conn *ConnectionWithChan)

func (*OutgoingPacket) SetBool

func (p *OutgoingPacket) SetBool(index int32, value bool)

func (*OutgoingPacket) SetByte

func (p *OutgoingPacket) SetByte(index int32, value byte)

func (*OutgoingPacket) SetByteArray

func (p *OutgoingPacket) SetByteArray(index int32, value []byte)

func (*OutgoingPacket) SetDouble

func (p *OutgoingPacket) SetDouble(index int32, value float64)

func (*OutgoingPacket) SetEntityMetadata

func (p *OutgoingPacket) SetEntityMetadata(value *metadata.Metadata)

func (*OutgoingPacket) SetFloat

func (p *OutgoingPacket) SetFloat(index int32, value float32)

func (*OutgoingPacket) SetInt

func (p *OutgoingPacket) SetInt(index int32, value int32)

func (*OutgoingPacket) SetIntArray

func (p *OutgoingPacket) SetIntArray(index int32, value []int32)

func (*OutgoingPacket) SetItem

func (p *OutgoingPacket) SetItem(index int32, value *item.Stack)

Item can be nil, if you want to set the slot to be empty

func (*OutgoingPacket) SetLong

func (p *OutgoingPacket) SetLong(index int32, value uint64)

func (*OutgoingPacket) SetLongArray

func (p *OutgoingPacket) SetLongArray(index int32, value []uint64)

func (*OutgoingPacket) SetNBT

func (p *OutgoingPacket) SetNBT(index int32, value *nbt.Tag)

func (*OutgoingPacket) SetNodes

func (p *OutgoingPacket) SetNodes(value []*pb.Node)

func (*OutgoingPacket) SetOther

func (p *OutgoingPacket) SetOther(index int32, value proto_v2.Message)

func (*OutgoingPacket) SetPosition

func (p *OutgoingPacket) SetPosition(index int32, pos block.Pos)

func (*OutgoingPacket) SetShort

func (p *OutgoingPacket) SetShort(index int32, value int16)

func (*OutgoingPacket) SetString

func (p *OutgoingPacket) SetString(index int32, value string)

func (*OutgoingPacket) SetTabCompleteSections

func (p *OutgoingPacket) SetTabCompleteSections(value []*pb.TabCompleteSection)

func (*OutgoingPacket) SetUUID

func (p *OutgoingPacket) SetUUID(index int32, value util.UUID)

type Serverbound

type Serverbound int32
const (
	// Special none type. Should be handled within the proxy, but it is valid
	// to send one of these to the server (it should be ignored).
	Serverbound_None Serverbound = iota
	Serverbound_TeleportConfirm
	Serverbound_QueryBlockNBT
	Serverbound_SetDifficulty
	Serverbound_ChatMessage
	Serverbound_ClientStatus
	Serverbound_ClientSettings
	Serverbound_TabComplete
	Serverbound_WindowConfirmation
	Serverbound_ClickWindowButton
	Serverbound_ClickWindow
	Serverbound_CloseWindow
	Serverbound_PluginMessage
	Serverbound_EditBook
	Serverbound_EntityNBTRequest
	Serverbound_InteractEntity
	Serverbound_KeepAlive
	Serverbound_LockDifficulty
	Serverbound_PlayerPosition
	Serverbound_PlayerPositionAndRotation
	Serverbound_PlayerRotation
	Serverbound_PlayerOnGround
	Serverbound_VehicleMove
	Serverbound_SteerBoat
	Serverbound_PickItem
	Serverbound_CraftRecipeRequest
	Serverbound_PlayerAbilities
	Serverbound_PlayerDigging
	Serverbound_EntityAction
	Serverbound_SteerVehicle
	Serverbound_RecipeBookData
	Serverbound_NameItem
	Serverbound_ResourcePackStatus
	Serverbound_AdvancementTab
	Serverbound_SelectTrade
	Serverbound_SetBeaconEffect
	Serverbound_HeldItemChange
	Serverbound_UpdateCommandBlock
	Serverbound_UpdateCommandBlockMinecart
	Serverbound_CreativeInventoryAction
	Serverbound_UpdateJigsawBlock
	Serverbound_UpdateStructureBlock
	Serverbound_UpdateSign
	Serverbound_Animation
	Serverbound_Spectate
	Serverbound_PlayerBlockPlace
	Serverbound_UseItem
)

func (Serverbound) String

func (s Serverbound) String() string

type Version

type Version int32
const (
	VINVALID Version = 0

	V1_8 Version = 47

	V1_9   Version = 107
	V1_9_1 Version = 109
	V1_9_2 Version = 109
	V1_9_3 Version = 110
	V1_9_4 Version = 110

	V1_10   Version = 210
	V1_10_1 Version = 210
	V1_10_2 Version = 210

	V1_11   Version = 315
	V1_11_1 Version = 316
	V1_11_2 Version = 316

	V1_12   Version = 335
	V1_12_1 Version = 338
	V1_12_2 Version = 340

	V1_13   Version = 393
	V1_13_1 Version = 401
	V1_13_2 Version = 404

	V1_14   Version = 477
	V1_14_1 Version = 480
	V1_14_2 Version = 485
	V1_14_3 Version = 490
	V1_14_4 Version = 498

	V1_15   Version = 573
	V1_15_1 Version = 575
	V1_15_2 Version = 578

	V1_16   Version = 735
	V1_16_1 Version = 736
	V1_16_2 Version = 751
	V1_16_3 Version = 753
	V1_16_4 Version = 754
	V1_16_5 Version = 754

	// Latest block version to use. Should only be a minor version
	// if the block was changed in that version.
	VLATEST Version = V1_16
)

All minecraft protocol versions. Snapshots are not going to be implemented. Even though some if these are the same (1.9.3, 1.9.4) is is better to be clear about which version is which. All 1.8 versions are the same, so I didn't bother making the subversions of that. Anything below 1.8 will not be supported. This is because there is no real reason to use 1.7, ever. 1.9 added the new combat, so 1.8 is the latest version that does not have that. Plus it's very fast. So 1.8 will always be supported, but nothing below that.

func (Version) BlockVersion

func (v Version) BlockVersion() block.Version

func (Version) String

func (v Version) String() string

type VersionsMap

type VersionsMap map[Version]map[string]uint32

Jump to

Keyboard shortcuts

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