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

@ -7,7 +7,7 @@ type AcceptTeleportation struct {
TeleportID int32 `mc:"VarInt"`
}
func (AcceptTeleportation) PacketID() packetid.ServerboundPacketID {
func (*AcceptTeleportation) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundAcceptTeleportation
}

View File

@ -11,7 +11,7 @@ type BlockEntityTagQuery struct {
Location pk.Position
}
func (BlockEntityTagQuery) PacketID() packetid.ServerboundPacketID {
func (*BlockEntityTagQuery) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundBlockEntityTagQuery
}

View File

@ -8,7 +8,7 @@ type BundleItemSelected struct {
SlotInBundle int32 `mc:"VarInt"`
}
func (BundleItemSelected) PacketID() packetid.ServerboundPacketID {
func (*BundleItemSelected) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundBundleItemSelected
}

View File

@ -7,7 +7,7 @@ type ChangeDifficulty struct {
Difficulty uint8
}
func (ChangeDifficulty) PacketID() packetid.ServerboundPacketID {
func (*ChangeDifficulty) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChangeDifficulty
}

View File

@ -7,7 +7,7 @@ type ChangeGameMode struct {
GameMode int32 `mc:"VarInt"`
}
func (ChangeGameMode) PacketID() packetid.ServerboundPacketID {
func (*ChangeGameMode) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChangeGameMode
}

View File

@ -18,7 +18,7 @@ type Chat struct {
Checksum int8
}
func (Chat) PacketID() packetid.ServerboundPacketID {
func (*Chat) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChat
}

View File

@ -7,7 +7,7 @@ type ChatAck struct {
MessageCount int32 `mc:"VarInt"`
}
func (ChatAck) PacketID() packetid.ServerboundPacketID {
func (*ChatAck) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChatAck
}

View File

@ -7,7 +7,7 @@ type ChatCommand struct {
Command string
}
func (ChatCommand) PacketID() packetid.ServerboundPacketID {
func (*ChatCommand) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChatCommand
}

View File

@ -22,7 +22,7 @@ type ChatCommandSigned struct {
Checksum int8
}
func (ChatCommandSigned) PacketID() packetid.ServerboundPacketID {
func (*ChatCommandSigned) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChatCommandSigned
}

View File

@ -12,7 +12,7 @@ type ChatSessionUpdate struct {
PublicKey user.PublicKey
}
func (ChatSessionUpdate) PacketID() packetid.ServerboundPacketID {
func (*ChatSessionUpdate) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChatSessionUpdate
}

View File

@ -7,7 +7,7 @@ type ChunkBatchReceived struct {
ChunksPerTick float32
}
func (ChunkBatchReceived) PacketID() packetid.ServerboundPacketID {
func (*ChunkBatchReceived) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChunkBatchReceived
}

View File

@ -7,7 +7,7 @@ type ClientCommand struct {
Action int32 `mc:"VarInt"`
}
func (ClientCommand) PacketID() packetid.ServerboundPacketID {
func (*ClientCommand) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundClientCommand
}

View File

@ -15,7 +15,7 @@ type ClientInformation struct {
ParticleStatus int32 `mc:"VarInt"`
}
func (ClientInformation) PacketID() packetid.ServerboundPacketID {
func (*ClientInformation) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundClientInformation
}

View File

@ -6,7 +6,7 @@ import "github.com/Tnze/go-mc/data/packetid"
type ClientTickEnd struct {
}
func (ClientTickEnd) PacketID() packetid.ServerboundPacketID {
func (*ClientTickEnd) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundClientTickEnd
}

View File

@ -8,7 +8,7 @@ type CommandSuggestion struct {
Text string
}
func (CommandSuggestion) PacketID() packetid.ServerboundPacketID {
func (*CommandSuggestion) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundCommandSuggestion
}

View File

@ -6,7 +6,7 @@ import "github.com/Tnze/go-mc/data/packetid"
type ConfigurationAcknowledged struct {
}
func (ConfigurationAcknowledged) PacketID() packetid.ServerboundPacketID {
func (*ConfigurationAcknowledged) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundConfigurationAcknowledged
}

View File

@ -8,7 +8,7 @@ type ContainerButtonClick struct {
ButtonID int32 `mc:"VarInt"`
}
func (ContainerButtonClick) PacketID() packetid.ServerboundPacketID {
func (*ContainerButtonClick) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundContainerButtonClick
}

View File

@ -22,7 +22,7 @@ type ContainerClick struct {
CarriedSlot slot.HashedSlot
}
func (ContainerClick) PacketID() packetid.ServerboundPacketID {
func (*ContainerClick) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundContainerClick
}

View File

@ -7,7 +7,7 @@ type ContainerClose struct {
WindowID int32 `mc:"VarInt"`
}
func (ContainerClose) PacketID() packetid.ServerboundPacketID {
func (*ContainerClose) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundContainerClose
}

View File

@ -9,7 +9,7 @@ type ContainerSlotStateChanged struct {
State bool
}
func (ContainerSlotStateChanged) PacketID() packetid.ServerboundPacketID {
func (*ContainerSlotStateChanged) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundContainerSlotStateChanged
}

View File

@ -10,7 +10,7 @@ type CookieResponse struct {
Payload []int8 `mc:"Byte"`
}
func (CookieResponse) PacketID() packetid.ServerboundPacketID {
func (*CookieResponse) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundCookieResponse
}

View File

@ -11,7 +11,7 @@ type CustomClickAction struct {
Payload nbt.RawMessage `mc:"NBT"`
}
func (CustomClickAction) PacketID() packetid.ServerboundPacketID {
func (*CustomClickAction) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundCustomClickAction
}

View File

@ -8,7 +8,7 @@ type CustomPayload struct {
Data []byte `mc:"ByteArray"`
}
func (CustomPayload) PacketID() packetid.ServerboundPacketID {
func (*CustomPayload) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundCustomPayload
}

View File

@ -7,7 +7,7 @@ type DebugSampleSubscription struct {
SampleType int32 `mc:"VarInt"`
}
func (DebugSampleSubscription) PacketID() packetid.ServerboundPacketID {
func (*DebugSampleSubscription) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundDebugSampleSubscription
}

View File

@ -11,7 +11,7 @@ type EditBook struct {
Title string
}
func (EditBook) PacketID() packetid.ServerboundPacketID {
func (*EditBook) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundEditBook
}

View File

@ -8,7 +8,7 @@ type EntityTagQuery struct {
EntityID int32 `mc:"VarInt"`
}
func (EntityTagQuery) PacketID() packetid.ServerboundPacketID {
func (*EntityTagQuery) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundEntityTagQuery
}

View File

@ -17,7 +17,7 @@ type Interact struct {
SneakKeyPressed bool
}
func (Interact) PacketID() packetid.ServerboundPacketID {
func (*Interact) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundInteract
}

View File

@ -12,7 +12,7 @@ type JigsawGenerate struct {
KeepJigsaws bool
}
func (JigsawGenerate) PacketID() packetid.ServerboundPacketID {
func (*JigsawGenerate) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundJigsawGenerate
}

View File

@ -7,7 +7,7 @@ type KeepAlive struct {
ID int64
}
func (KeepAlive) PacketID() packetid.ServerboundPacketID {
func (*KeepAlive) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundKeepAlive
}

View File

@ -7,7 +7,7 @@ type LockDifficulty struct {
Locked bool
}
func (LockDifficulty) PacketID() packetid.ServerboundPacketID {
func (*LockDifficulty) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundLockDifficulty
}

View File

@ -8,7 +8,7 @@ type MovePlayerPos struct {
Flags int8
}
func (MovePlayerPos) PacketID() packetid.ServerboundPacketID {
func (*MovePlayerPos) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMovePlayerPos
}

View File

@ -9,7 +9,7 @@ type MovePlayerPosRot struct {
Flags int8
}
func (MovePlayerPosRot) PacketID() packetid.ServerboundPacketID {
func (*MovePlayerPosRot) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMovePlayerPosRot
}

View File

@ -8,7 +8,7 @@ type MovePlayerRot struct {
Flags int8
}
func (MovePlayerRot) PacketID() packetid.ServerboundPacketID {
func (*MovePlayerRot) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMovePlayerRot
}

View File

@ -7,7 +7,7 @@ type MovePlayerStatusOnly struct {
Flags int8
}
func (MovePlayerStatusOnly) PacketID() packetid.ServerboundPacketID {
func (*MovePlayerStatusOnly) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMovePlayerStatusOnly
}

View File

@ -9,7 +9,7 @@ type MoveVehicle struct {
OnGround bool
}
func (MoveVehicle) PacketID() packetid.ServerboundPacketID {
func (*MoveVehicle) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMoveVehicle
}

View File

@ -7,7 +7,7 @@ type PaddleBoat struct {
LeftTurning, RightTurning bool
}
func (PaddleBoat) PacketID() packetid.ServerboundPacketID {
func (*PaddleBoat) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPaddleBoat
}

View File

@ -11,7 +11,7 @@ type PickItemFromBlock struct {
IncludeData bool
}
func (PickItemFromBlock) PacketID() packetid.ServerboundPacketID {
func (*PickItemFromBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPickItemFromBlock
}

View File

@ -8,7 +8,7 @@ type PickItemFromEntity struct {
IncludeData bool
}
func (PickItemFromEntity) PacketID() packetid.ServerboundPacketID {
func (*PickItemFromEntity) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPickItemFromEntity
}

View File

@ -7,7 +7,7 @@ type PingRequest struct {
payload int64
}
func (PingRequest) PacketID() packetid.ServerboundPacketID {
func (*PingRequest) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPingRequest
}

View File

@ -9,7 +9,7 @@ type PlaceRecipe struct {
MakeAll bool
}
func (PlaceRecipe) PacketID() packetid.ServerboundPacketID {
func (*PlaceRecipe) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlaceRecipe
}

View File

@ -7,7 +7,7 @@ type PlayerAbilities struct {
Flags int8
}
func (PlayerAbilities) PacketID() packetid.ServerboundPacketID {
func (*PlayerAbilities) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerAbilities
}

View File

@ -13,7 +13,7 @@ type PlayerAction struct {
Sequence int32 `mc:"VarInt"`
}
func (PlayerAction) PacketID() packetid.ServerboundPacketID {
func (*PlayerAction) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerAction
}

View File

@ -9,7 +9,7 @@ type PlayerCommand struct {
JumpBoost int32 `mc:"VarInt"`
}
func (PlayerCommand) PacketID() packetid.ServerboundPacketID {
func (*PlayerCommand) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerCommand
}

View File

@ -7,7 +7,7 @@ type PlayerInput struct {
Flags uint8
}
func (PlayerInput) PacketID() packetid.ServerboundPacketID {
func (*PlayerInput) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerInput
}

View File

@ -6,7 +6,7 @@ import "github.com/Tnze/go-mc/data/packetid"
type PlayerLoaded struct {
}
func (PlayerLoaded) PacketID() packetid.ServerboundPacketID {
func (*PlayerLoaded) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerLoaded
}

View File

@ -6,7 +6,7 @@ import "github.com/Tnze/go-mc/data/packetid"
type Pong struct {
}
func (Pong) PacketID() packetid.ServerboundPacketID {
func (*Pong) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPong
}

View File

@ -9,7 +9,7 @@ type RecipeBookChangeSettings struct {
FilterActive bool
}
func (RecipeBookChangeSettings) PacketID() packetid.ServerboundPacketID {
func (*RecipeBookChangeSettings) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundRecipeBookChangeSettings
}

View File

@ -7,7 +7,7 @@ type RecipeBookSeenRecipe struct {
RecipeID int32 `mc:"VarInt"`
}
func (RecipeBookSeenRecipe) PacketID() packetid.ServerboundPacketID {
func (*RecipeBookSeenRecipe) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundRecipeBookSeenRecipe
}

View File

@ -7,7 +7,7 @@ type RenameItem struct {
ItemName string
}
func (RenameItem) PacketID() packetid.ServerboundPacketID {
func (*RenameItem) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundRenameItem
}

View File

@ -11,7 +11,7 @@ type ResourcePack struct {
Result int32 `mc:"VarInt"`
}
func (ResourcePack) PacketID() packetid.ServerboundPacketID {
func (*ResourcePack) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundResourcePack
}

View File

@ -9,7 +9,7 @@ type SeenAdvancements struct {
TabID string `mc:"Identifier"`
}
func (SeenAdvancements) PacketID() packetid.ServerboundPacketID {
func (*SeenAdvancements) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSeenAdvancements
}

View File

@ -7,7 +7,7 @@ type SelectTrade struct {
SelectedSlot int32 `mc:"VarInt"`
}
func (SelectTrade) PacketID() packetid.ServerboundPacketID {
func (*SelectTrade) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSelectTrade
}

View File

@ -12,7 +12,7 @@ type SetBeacon struct {
SecondaryEffect int32 `mc:"VarInt"`
}
func (SetBeacon) PacketID() packetid.ServerboundPacketID {
func (*SetBeacon) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetBeacon
}

View File

@ -7,7 +7,7 @@ type SetCarriedItem struct {
Slot int16
}
func (SetCarriedItem) PacketID() packetid.ServerboundPacketID {
func (*SetCarriedItem) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetCarriedItem
}

View File

@ -13,7 +13,7 @@ type SetCommandBlock struct {
Flags int8
}
func (SetCommandBlock) PacketID() packetid.ServerboundPacketID {
func (*SetCommandBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetCommandBlock
}

View File

@ -9,7 +9,7 @@ type SetCommandMinecart struct {
TrackOutput bool
}
func (SetCommandMinecart) PacketID() packetid.ServerboundPacketID {
func (*SetCommandMinecart) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetCommandMinecart
}

View File

@ -11,7 +11,7 @@ type SetCreativeModeSlot struct {
ClickedItem slot.Slot
}
func (SetCreativeModeSlot) PacketID() packetid.ServerboundPacketID {
func (*SetCreativeModeSlot) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetCreativeModeSlot
}

View File

@ -17,7 +17,7 @@ type SetJigsawBlock struct {
PlacementPriority int32 `mc:"VarInt"`
}
func (SetJigsawBlock) PacketID() packetid.ServerboundPacketID {
func (*SetJigsawBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetJigsawBlock
}

View File

@ -21,7 +21,7 @@ type SetStructureBlock struct {
Flags int8
}
func (SetStructureBlock) PacketID() packetid.ServerboundPacketID {
func (*SetStructureBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetStructureBlock
}

View File

@ -12,7 +12,7 @@ type SetTestBlock struct {
Message string
}
func (SetTestBlock) PacketID() packetid.ServerboundPacketID {
func (*SetTestBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetTestBlock
}

View File

@ -12,7 +12,7 @@ type SignUpdate struct {
Line1, Line2, Line3, Line4 string
}
func (SignUpdate) PacketID() packetid.ServerboundPacketID {
func (*SignUpdate) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSignUpdate
}

View File

@ -7,7 +7,7 @@ type Swing struct {
Hand int32 `mc:"VarInt"`
}
func (Swing) PacketID() packetid.ServerboundPacketID {
func (*Swing) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSwing
}

View File

@ -10,7 +10,7 @@ type TeleportToEntity struct {
TargetPlayer uuid.UUID `mc:"UUID"`
}
func (TeleportToEntity) PacketID() packetid.ServerboundPacketID {
func (*TeleportToEntity) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundTeleportToEntity
}

View File

@ -22,7 +22,7 @@ type TestInstanceBlockAction struct {
ErrorMessage chat.Message
}
func (TestInstanceBlockAction) PacketID() packetid.ServerboundPacketID {
func (*TestInstanceBlockAction) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundTestInstanceBlockAction
}

View File

@ -9,7 +9,7 @@ type UseItem struct {
Yaw, Pitch float32
}
func (UseItem) PacketID() packetid.ServerboundPacketID {
func (*UseItem) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundUseItem
}

View File

@ -16,7 +16,7 @@ type UseItemOn struct {
Sequence int32 `mc:"VarInt"`
}
func (UseItemOn) PacketID() packetid.ServerboundPacketID {
func (*UseItemOn) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundUseItemOn
}