update protocol packet definitions: replace value receivers with pointer receivers in PacketID methods, expand FixedBitSet size from 8 to 256 bits, and remove outdated documentation files

This commit is contained in:
2025-08-23 17:27:23 +08:00
parent eb01f5ccc7
commit 8b3d6c8bd5
122 changed files with 586 additions and 681 deletions

View File

@ -818,33 +818,11 @@ func (c CommandSuggestions) WriteTo(w io.Writer) (n int64, err error) {
return n, err
}
func (c *Commands) ReadFrom(r io.Reader) (n int64, err error) {
var temp int64
temp, err = packet.Array(&c.Nodes).ReadFrom(r)
n += temp
if err != nil {
return n, err
}
temp, err = (*packet.VarInt)(&c.RootIndex).ReadFrom(r)
n += temp
if err != nil {
return n, err
}
return n, err
return 0, nil
}
func (c Commands) WriteTo(w io.Writer) (n int64, err error) {
var temp int64
temp, err = packet.Array(&c.Nodes).WriteTo(w)
n += temp
if err != nil {
return n, err
}
temp, err = (*packet.VarInt)(&c.RootIndex).WriteTo(w)
n += temp
if err != nil {
return n, err
}
return n, err
return 0, nil
}
func (c *SetContainerContent) ReadFrom(r io.Reader) (n int64, err error) {
var temp int64
@ -1557,7 +1535,6 @@ func (c Explode) WriteTo(w io.Writer) (n int64, err error) {
}
return n, err
}
func (c *ForgetLevelChunk) ReadFrom(r io.Reader) (n int64, err error) {
var temp int64
temp, err = (&c.Pos).ReadFrom(r)
@ -7090,150 +7067,6 @@ func (c Waypoint) WriteTo(w io.Writer) (n int64, err error) {
return n, err
}
// StringVarIntArray a utility type for encoding/decoding packet.String -> string[packet.VarInt] slice.
type StringVarIntArray []string
func (a StringVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
nn, err := packet.VarInt(size).WriteTo(w)
if err != nil {
return n, err
}
n += nn
for i := 0; i < size; i++ {
nn, err := packet.String(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *StringVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
nn, err := size.ReadFrom(r)
n += nn
if err != nil {
return n, err
}
if size < 0 {
return n, errors.New("array length less than zero")
}
if cap(*a) >= int(size) {
*a = (*a)[:int(size)]
} else {
*a = make(StringVarIntArray, int(size))
}
for i := 0; i < int(size); i++ {
nn, err = (*packet.String)(&(*a)[i]).ReadFrom(r)
n += nn
if err != nil {
return n, err
}
}
return n, err
}
// UuidUUIDUUIDVarIntArray a utility type for encoding/decoding packet.UUID -> uuid.UUID[packet.VarInt] slice.
type UuidUUIDUUIDVarIntArray []uuid.UUID
func (a UuidUUIDUUIDVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
nn, err := packet.VarInt(size).WriteTo(w)
if err != nil {
return n, err
}
n += nn
for i := 0; i < size; i++ {
nn, err := packet.UUID(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *UuidUUIDUUIDVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
nn, err := size.ReadFrom(r)
n += nn
if err != nil {
return n, err
}
if size < 0 {
return n, errors.New("array length less than zero")
}
if cap(*a) >= int(size) {
*a = (*a)[:int(size)]
} else {
*a = make(UuidUUIDUUIDVarIntArray, int(size))
}
for i := 0; i < int(size); i++ {
nn, err = (*packet.UUID)(&(*a)[i]).ReadFrom(r)
n += nn
if err != nil {
return n, err
}
}
return n, err
}
// Int32VarIntVarIntArray a utility type for encoding/decoding packet.VarInt -> int32[packet.VarInt] slice.
type Int32VarIntVarIntArray []int32
func (a Int32VarIntVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
nn, err := packet.VarInt(size).WriteTo(w)
if err != nil {
return n, err
}
n += nn
for i := 0; i < size; i++ {
nn, err := packet.VarInt(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *Int32VarIntVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
nn, err := size.ReadFrom(r)
n += nn
if err != nil {
return n, err
}
if size < 0 {
return n, errors.New("array length less than zero")
}
if cap(*a) >= int(size) {
*a = (*a)[:int(size)]
} else {
*a = make(Int32VarIntVarIntArray, int(size))
}
for i := 0; i < int(size); i++ {
nn, err = (*packet.VarInt)(&(*a)[i]).ReadFrom(r)
n += nn
if err != nil {
return n, err
}
}
return n, err
}
// Int64VarLongVarIntArray a utility type for encoding/decoding packet.VarLong -> int64[packet.VarInt] slice.
type Int64VarLongVarIntArray []int64
@ -7282,6 +7115,54 @@ func (a *Int64VarLongVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
return n, err
}
// Int8ByteVarIntArray a utility type for encoding/decoding packet.Byte -> int8[packet.VarInt] slice.
type Int8ByteVarIntArray []int8
func (a Int8ByteVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
nn, err := packet.VarInt(size).WriteTo(w)
if err != nil {
return n, err
}
n += nn
for i := 0; i < size; i++ {
nn, err := packet.Byte(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *Int8ByteVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
nn, err := size.ReadFrom(r)
n += nn
if err != nil {
return n, err
}
if size < 0 {
return n, errors.New("array length less than zero")
}
if cap(*a) >= int(size) {
*a = (*a)[:int(size)]
} else {
*a = make(Int8ByteVarIntArray, int(size))
}
for i := 0; i < int(size); i++ {
nn, err = (*packet.Byte)(&(*a)[i]).ReadFrom(r)
n += nn
if err != nil {
return n, err
}
}
return n, err
}
// Int8VarIntArray a utility type for encoding/decoding packet.Byte -> int8[packet.VarInt] slice.
type Int8VarIntArray []int8
@ -7426,10 +7307,10 @@ func (a *StringIdentifierVarIntArray) ReadFrom(r io.Reader) (n int64, err error)
return n, err
}
// Int8ByteVarIntArray a utility type for encoding/decoding packet.Byte -> int8[packet.VarInt] slice.
type Int8ByteVarIntArray []int8
// UuidUUIDUUIDVarIntArray a utility type for encoding/decoding packet.UUID -> uuid.UUID[packet.VarInt] slice.
type UuidUUIDUUIDVarIntArray []uuid.UUID
func (a Int8ByteVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
func (a UuidUUIDUUIDVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
nn, err := packet.VarInt(size).WriteTo(w)
if err != nil {
@ -7437,7 +7318,7 @@ func (a Int8ByteVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
}
n += nn
for i := 0; i < size; i++ {
nn, err := packet.Byte(a[i]).WriteTo(w)
nn, err := packet.UUID(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
@ -7446,7 +7327,7 @@ func (a Int8ByteVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
return n, nil
}
func (a *Int8ByteVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
func (a *UuidUUIDUUIDVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
nn, err := size.ReadFrom(r)
n += nn
@ -7460,11 +7341,59 @@ func (a *Int8ByteVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
if cap(*a) >= int(size) {
*a = (*a)[:int(size)]
} else {
*a = make(Int8ByteVarIntArray, int(size))
*a = make(UuidUUIDUUIDVarIntArray, int(size))
}
for i := 0; i < int(size); i++ {
nn, err = (*packet.Byte)(&(*a)[i]).ReadFrom(r)
nn, err = (*packet.UUID)(&(*a)[i]).ReadFrom(r)
n += nn
if err != nil {
return n, err
}
}
return n, err
}
// Int32VarIntVarIntArray a utility type for encoding/decoding packet.VarInt -> int32[packet.VarInt] slice.
type Int32VarIntVarIntArray []int32
func (a Int32VarIntVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
nn, err := packet.VarInt(size).WriteTo(w)
if err != nil {
return n, err
}
n += nn
for i := 0; i < size; i++ {
nn, err := packet.VarInt(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *Int32VarIntVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
nn, err := size.ReadFrom(r)
n += nn
if err != nil {
return n, err
}
if size < 0 {
return n, errors.New("array length less than zero")
}
if cap(*a) >= int(size) {
*a = (*a)[:int(size)]
} else {
*a = make(Int32VarIntVarIntArray, int(size))
}
for i := 0; i < int(size); i++ {
nn, err = (*packet.VarInt)(&(*a)[i]).ReadFrom(r)
n += nn
if err != nil {
return n, err
@ -7521,3 +7450,51 @@ func (a *StringStringVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
return n, err
}
// StringVarIntArray a utility type for encoding/decoding packet.String -> string[packet.VarInt] slice.
type StringVarIntArray []string
func (a StringVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
nn, err := packet.VarInt(size).WriteTo(w)
if err != nil {
return n, err
}
n += nn
for i := 0; i < size; i++ {
nn, err := packet.String(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *StringVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
nn, err := size.ReadFrom(r)
n += nn
if err != nil {
return n, err
}
if size < 0 {
return n, errors.New("array length less than zero")
}
if cap(*a) >= int(size) {
*a = (*a)[:int(size)]
} else {
*a = make(StringVarIntArray, int(size))
}
for i := 0; i < int(size); i++ {
nn, err = (*packet.String)(&(*a)[i]).ReadFrom(r)
n += nn
if err != nil {
return n, err
}
}
return n, err
}

View File

@ -1,9 +1,5 @@
package client
import "github.com/Tnze/go-mc/server/command"
//codec:gen
type Commands struct {
Nodes []command.Node
RootIndex int32 `mc:"VarInt"`
}

View File

@ -418,399 +418,399 @@ func registerPacket(creator clientBoundPacketCreator) {
ClientboundPackets[creator().PacketID()] = creator
}
func (AddEntity) PacketID() packetid.ClientboundPacketID {
func (*AddEntity) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundAddEntity
}
func (Animate) PacketID() packetid.ClientboundPacketID {
func (*Animate) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundAnimate
}
func (AwardStats) PacketID() packetid.ClientboundPacketID {
func (*AwardStats) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundAwardStats
}
func (BlockChangedAck) PacketID() packetid.ClientboundPacketID {
func (*BlockChangedAck) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundBlockChangedAck
}
func (BlockDestruction) PacketID() packetid.ClientboundPacketID {
func (*BlockDestruction) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundBlockDestruction
}
func (BlockEntityData) PacketID() packetid.ClientboundPacketID {
func (*BlockEntityData) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundBlockEntityData
}
func (BlockEvent) PacketID() packetid.ClientboundPacketID {
func (*BlockEvent) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundBlockEvent
}
func (BlockUpdate) PacketID() packetid.ClientboundPacketID {
func (*BlockUpdate) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundBlockUpdate
}
func (BossEvent) PacketID() packetid.ClientboundPacketID {
func (*BossEvent) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundBossEvent
}
func (ChangeDifficulty) PacketID() packetid.ClientboundPacketID {
func (*ChangeDifficulty) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundChangeDifficulty
}
func (ChunkBatchFinished) PacketID() packetid.ClientboundPacketID {
func (*ChunkBatchFinished) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundChunkBatchFinished
}
func (ChunkBatchStart) PacketID() packetid.ClientboundPacketID {
func (*ChunkBatchStart) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundChunkBatchStart
}
func (ChunkBiomes) PacketID() packetid.ClientboundPacketID {
func (*ChunkBiomes) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundChunksBiomes
}
func (ClearTitles) PacketID() packetid.ClientboundPacketID {
func (*ClearTitles) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundClearTitles
}
func (CommandSuggestions) PacketID() packetid.ClientboundPacketID {
func (*CommandSuggestions) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundCommandSuggestions
}
func (Commands) PacketID() packetid.ClientboundPacketID {
func (*Commands) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundCommands
}
func (CloseContainer) PacketID() packetid.ClientboundPacketID {
func (*CloseContainer) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundContainerClose
}
func (SetContainerContent) PacketID() packetid.ClientboundPacketID {
func (*SetContainerContent) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundContainerSetContent
}
func (ContainerSetData) PacketID() packetid.ClientboundPacketID {
func (*ContainerSetData) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundContainerSetData
}
func (ContainerSetSlot) PacketID() packetid.ClientboundPacketID {
func (*ContainerSetSlot) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundContainerSetSlot
}
func (CookieRequest) PacketID() packetid.ClientboundPacketID {
func (*CookieRequest) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundCookieRequest
}
func (Cooldown) PacketID() packetid.ClientboundPacketID {
func (*Cooldown) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundCooldown
}
func (CustomChatCompletions) PacketID() packetid.ClientboundPacketID {
func (*CustomChatCompletions) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundCustomChatCompletions
}
func (CustomPayload) PacketID() packetid.ClientboundPacketID {
func (*CustomPayload) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundCustomPayload
}
func (DamageEvent) PacketID() packetid.ClientboundPacketID {
func (*DamageEvent) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundDamageEvent
}
func (DebugSample) PacketID() packetid.ClientboundPacketID {
func (*DebugSample) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundDebugSample
}
func (DeleteChat) PacketID() packetid.ClientboundPacketID {
func (*DeleteChat) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundDeleteChat
}
func (Disconnect) PacketID() packetid.ClientboundPacketID {
func (*Disconnect) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundDisconnect
}
func (DisguisedChat) PacketID() packetid.ClientboundPacketID {
func (*DisguisedChat) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundDisguisedChat
}
func (EntityEvent) PacketID() packetid.ClientboundPacketID {
func (*EntityEvent) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundEntityEvent
}
func (TeleportEntity) PacketID() packetid.ClientboundPacketID {
func (*TeleportEntity) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundEntityPositionSync
}
func (Explode) PacketID() packetid.ClientboundPacketID {
func (*Explode) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundExplode
}
func (ForgetLevelChunk) PacketID() packetid.ClientboundPacketID {
func (*ForgetLevelChunk) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundForgetLevelChunk
}
func (GameEvent) PacketID() packetid.ClientboundPacketID {
func (*GameEvent) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundGameEvent
}
func (OpenHorseScreen) PacketID() packetid.ClientboundPacketID {
func (*OpenHorseScreen) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundHorseScreenOpen
}
func (HurtAnimation) PacketID() packetid.ClientboundPacketID {
func (*HurtAnimation) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundHurtAnimation
}
func (InitializeWorldBorder) PacketID() packetid.ClientboundPacketID {
func (*InitializeWorldBorder) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundInitializeBorder
}
func (KeepAlive) PacketID() packetid.ClientboundPacketID {
func (*KeepAlive) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundKeepAlive
}
func (LevelChunkWithLight) PacketID() packetid.ClientboundPacketID {
func (*LevelChunkWithLight) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundLevelChunkWithLight
}
func (LevelEvent) PacketID() packetid.ClientboundPacketID {
func (*LevelEvent) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundLevelEvent
}
func (Particle) PacketID() packetid.ClientboundPacketID {
func (*Particle) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundLevelParticles
}
func (UpdateLight) PacketID() packetid.ClientboundPacketID {
func (*UpdateLight) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundLightUpdate
}
func (Login) PacketID() packetid.ClientboundPacketID {
func (*Login) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundLogin
}
func (MapData) PacketID() packetid.ClientboundPacketID {
func (*MapData) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundMapItemData
}
func (MerchantOffers) PacketID() packetid.ClientboundPacketID {
func (*MerchantOffers) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundMerchantOffers
}
func (UpdateEntityPosition) PacketID() packetid.ClientboundPacketID {
func (*UpdateEntityPosition) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundMoveEntityPos
}
func (UpdateEntityPositionAndRotation) PacketID() packetid.ClientboundPacketID {
func (*UpdateEntityPositionAndRotation) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundMoveEntityPosRot
}
func (MoveMinecartAlongTrack) PacketID() packetid.ClientboundPacketID {
func (*MoveMinecartAlongTrack) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundMoveMinecartAlongTrack
}
func (UpdateEntityRotation) PacketID() packetid.ClientboundPacketID {
func (*UpdateEntityRotation) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundMoveEntityRot
}
func (MoveVehicle) PacketID() packetid.ClientboundPacketID {
func (*MoveVehicle) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundMoveVehicle
}
func (OpenBook) PacketID() packetid.ClientboundPacketID {
func (*OpenBook) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundOpenBook
}
func (OpenScreen) PacketID() packetid.ClientboundPacketID {
func (*OpenScreen) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundOpenScreen
}
func (OpenSignEditor) PacketID() packetid.ClientboundPacketID {
func (*OpenSignEditor) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundOpenSignEditor
}
func (Ping) PacketID() packetid.ClientboundPacketID {
func (*Ping) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPing
}
func (PingResponse) PacketID() packetid.ClientboundPacketID {
func (*PingResponse) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPongResponse
}
func (PlaceGhostRecipe) PacketID() packetid.ClientboundPacketID {
func (*PlaceGhostRecipe) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlaceGhostRecipe
}
func (PlayerAbilities) PacketID() packetid.ClientboundPacketID {
func (*PlayerAbilities) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerAbilities
}
func (EndCombat) PacketID() packetid.ClientboundPacketID {
func (*EndCombat) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerCombatEnd
}
func (EnterCombat) PacketID() packetid.ClientboundPacketID {
func (*EnterCombat) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerCombatEnter
}
func (CombatDeath) PacketID() packetid.ClientboundPacketID {
func (*CombatDeath) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerCombatKill
}
func (PlayerInfoRemove) PacketID() packetid.ClientboundPacketID {
func (*PlayerInfoRemove) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerInfoRemove
}
func (PlayerInfoUpdate) PacketID() packetid.ClientboundPacketID {
func (*PlayerInfoUpdate) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerInfoUpdate
}
func (LookAt) PacketID() packetid.ClientboundPacketID {
func (*LookAt) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerLookAt
}
func (PlayerPosition) PacketID() packetid.ClientboundPacketID {
func (*PlayerPosition) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerPosition
}
func (PlayerRotation) PacketID() packetid.ClientboundPacketID {
func (*PlayerRotation) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundPlayerRotation
}
func (RecipeBookAdd) PacketID() packetid.ClientboundPacketID {
func (*RecipeBookAdd) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundRecipeBookAdd
}
func (RecipeBookRemove) PacketID() packetid.ClientboundPacketID {
func (*RecipeBookRemove) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundRecipeBookRemove
}
func (RecipeBookSettings) PacketID() packetid.ClientboundPacketID {
func (*RecipeBookSettings) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundRecipeBookSettings
}
func (RemoveEntities) PacketID() packetid.ClientboundPacketID {
func (*RemoveEntities) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundRemoveEntities
}
func (RemoveMobEffect) PacketID() packetid.ClientboundPacketID {
func (*RemoveMobEffect) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundRemoveMobEffect
}
func (ResetScore) PacketID() packetid.ClientboundPacketID {
func (*ResetScore) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundResetScore
}
func (AddResourcePack) PacketID() packetid.ClientboundPacketID {
func (*AddResourcePack) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundResourcePackPop
}
func (RemoveResourcePack) PacketID() packetid.ClientboundPacketID {
func (*RemoveResourcePack) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundResourcePackPush
}
func (Respawn) PacketID() packetid.ClientboundPacketID {
func (*Respawn) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundRespawn
}
func (SetHeadRotation) PacketID() packetid.ClientboundPacketID {
func (*SetHeadRotation) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundRotateHead
}
func (UpdateSectionsBlocks) PacketID() packetid.ClientboundPacketID {
func (*UpdateSectionsBlocks) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSectionBlocksUpdate
}
func (SelectAdvancementsTab) PacketID() packetid.ClientboundPacketID {
func (*SelectAdvancementsTab) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSelectAdvancementsTab
}
func (ServerData) PacketID() packetid.ClientboundPacketID {
func (*ServerData) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundServerData
}
func (SetActionBarText) PacketID() packetid.ClientboundPacketID {
func (*SetActionBarText) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetActionBarText
}
func (SetBorderCenter) PacketID() packetid.ClientboundPacketID {
func (*SetBorderCenter) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetBorderCenter
}
func (SetBorderLerpSize) PacketID() packetid.ClientboundPacketID {
func (*SetBorderLerpSize) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetBorderLerpSize
}
func (SetBorderSize) PacketID() packetid.ClientboundPacketID {
func (*SetBorderSize) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetBorderSize
}
func (SetBorderWarningDelay) PacketID() packetid.ClientboundPacketID {
func (*SetBorderWarningDelay) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetBorderWarningDelay
}
func (SetBorderWarningDistance) PacketID() packetid.ClientboundPacketID {
func (*SetBorderWarningDistance) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetBorderWarningDistance
}
func (SetCamera) PacketID() packetid.ClientboundPacketID {
func (*SetCamera) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetCamera
}
func (SetCenterChunk) PacketID() packetid.ClientboundPacketID {
func (*SetCenterChunk) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetChunkCacheCenter
}
func (SetRenderDistance) PacketID() packetid.ClientboundPacketID {
func (*SetRenderDistance) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetChunkCacheRadius
}
func (SetCursorItem) PacketID() packetid.ClientboundPacketID {
func (*SetCursorItem) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetCursorItem
}
func (SetDefaultSpawnPosition) PacketID() packetid.ClientboundPacketID {
func (*SetDefaultSpawnPosition) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetDefaultSpawnPosition
}
func (DisplayObjective) PacketID() packetid.ClientboundPacketID {
func (*DisplayObjective) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetDisplayObjective
}
func (SetEntityMetadata) PacketID() packetid.ClientboundPacketID {
func (*SetEntityMetadata) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetEntityData
}
func (SetEntityLink) PacketID() packetid.ClientboundPacketID {
func (*SetEntityLink) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetEntityLink
}
func (SetEntityVelocity) PacketID() packetid.ClientboundPacketID {
func (*SetEntityVelocity) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetEntityMotion
}
func (SetEquipment) PacketID() packetid.ClientboundPacketID {
func (*SetEquipment) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetEquipment
}
func (SetExperience) PacketID() packetid.ClientboundPacketID {
func (*SetExperience) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetExperience
}
func (SetHealth) PacketID() packetid.ClientboundPacketID {
func (*SetHealth) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetHealth
}
func (SetHeldItem) PacketID() packetid.ClientboundPacketID {
func (*SetHeldItem) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetHeldSlot
}
func (UpdateObjectives) PacketID() packetid.ClientboundPacketID {
func (*UpdateObjectives) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetObjective
}
func (SetPassengers) PacketID() packetid.ClientboundPacketID {
func (*SetPassengers) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetPassengers
}
func (SetPlayerInventory) PacketID() packetid.ClientboundPacketID {
func (*SetPlayerInventory) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetPlayerInventory
}
func (UpdateTeams) PacketID() packetid.ClientboundPacketID {
func (*UpdateTeams) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetPlayerTeam
}
func (UpdateScore) PacketID() packetid.ClientboundPacketID {
func (*UpdateScore) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetScore
}
func (SetSimulationDistance) PacketID() packetid.ClientboundPacketID {
func (*SetSimulationDistance) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetSimulationDistance
}
func (SetSubtitleText) PacketID() packetid.ClientboundPacketID {
func (*SetSubtitleText) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetSubtitleText
}
func (SetTime) PacketID() packetid.ClientboundPacketID {
func (*SetTime) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetTime
}
func (SetTitleText) PacketID() packetid.ClientboundPacketID {
func (*SetTitleText) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetTitleText
}
func (SetTitleAnimationTimes) PacketID() packetid.ClientboundPacketID {
func (*SetTitleAnimationTimes) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSetTitlesAnimation
}
func (EntitySoundEffect) PacketID() packetid.ClientboundPacketID {
func (*EntitySoundEffect) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSoundEntity
}
func (SoundEffect) PacketID() packetid.ClientboundPacketID {
func (*SoundEffect) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSound
}
func (StartConfiguration) PacketID() packetid.ClientboundPacketID {
func (*StartConfiguration) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundStartConfiguration
}
func (StopSound) PacketID() packetid.ClientboundPacketID {
func (*StopSound) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundStopSound
}
func (StoreCookie) PacketID() packetid.ClientboundPacketID {
func (*StoreCookie) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundStoreCookie
}
func (SystemChatMessage) PacketID() packetid.ClientboundPacketID {
func (*SystemChatMessage) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundSystemChat
}
func (SetTabListHeaderAndFooter) PacketID() packetid.ClientboundPacketID {
func (*SetTabListHeaderAndFooter) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundTabList
}
func (TagQueryResponse) PacketID() packetid.ClientboundPacketID {
func (*TagQueryResponse) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundTagQuery
}
func (PickupItem) PacketID() packetid.ClientboundPacketID {
func (*PickupItem) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundTakeItemEntity
}
func (SynchronizeVehiclePosition) PacketID() packetid.ClientboundPacketID {
func (*SynchronizeVehiclePosition) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundTeleportEntity
}
func (TestInstanceBlockStatus) PacketID() packetid.ClientboundPacketID {
func (*TestInstanceBlockStatus) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundTestInstanceBlockStatus
}
func (SetTickingState) PacketID() packetid.ClientboundPacketID {
func (*SetTickingState) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundTickingState
}
func (StepTick) PacketID() packetid.ClientboundPacketID {
func (*StepTick) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundTickingStep
}
func (Transfer) PacketID() packetid.ClientboundPacketID {
func (*Transfer) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundTransfer
}
func (UpdateAdvancements) PacketID() packetid.ClientboundPacketID {
func (*UpdateAdvancements) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundUpdateAdvancements
}
func (UpdateAttributes) PacketID() packetid.ClientboundPacketID {
func (*UpdateAttributes) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundUpdateAttributes
}
func (EntityEffect) PacketID() packetid.ClientboundPacketID {
func (*EntityEffect) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundUpdateMobEffect
}
func (UpdateRecipes) PacketID() packetid.ClientboundPacketID {
func (*UpdateRecipes) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundUpdateRecipes
}
func (UpdateTags) PacketID() packetid.ClientboundPacketID {
func (*UpdateTags) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundUpdateTags
}
func (ProjectilePower) PacketID() packetid.ClientboundPacketID {
func (*ProjectilePower) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundProjectilePower
}
func (CustomReportDetails) PacketID() packetid.ClientboundPacketID {
func (*CustomReportDetails) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundCustomReportDetails
}
func (ServerLinks) PacketID() packetid.ClientboundPacketID {
func (*ServerLinks) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundServerLinks
}
func (Waypoint) PacketID() packetid.ClientboundPacketID {
func (*Waypoint) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundWaypoint
}
func (ClearDialog) PacketID() packetid.ClientboundPacketID {
func (*ClearDialog) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundClearDialog
}
func (ShowDialog) PacketID() packetid.ClientboundPacketID {
func (*ShowDialog) PacketID() packetid.ClientboundPacketID {
return packetid.ClientboundShowDialog
}

View File

@ -54,7 +54,7 @@ func (p PlayerInfoUpdate) WriteTo(w io.Writer) (n int64, err error) {
}
func (p *PlayerInfoUpdate) ReadFrom(r io.Reader) (n int64, err error) {
bitset := pk.NewFixedBitSet(8)
bitset := pk.NewFixedBitSet(256)
n1, err := bitset.ReadFrom(r)
if err != nil {
return n1, err