1.21.6 Serverbound PlayState Packets

This commit is contained in:
2025-06-20 07:46:29 +08:00
parent 195d34f32d
commit 06863ef845
84 changed files with 4293 additions and 274 deletions

View File

@ -3646,94 +3646,6 @@ func (a *BoolVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
return n, err
}
// Int32VarIntArray a utility type for encoding/decoding packet.Int -> int32[packet.VarInt] slice.
type Int32VarIntArray []int32
func (a Int32VarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
if nn, err := packet.VarInt(size).WriteTo(w); err != nil {
return n, err
} else {
n += nn
}
for i := 0; i < size; i++ {
nn, err := packet.Int(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *Int32VarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
if nn, err := size.ReadFrom(r); err != nil {
return nn, err
} else {
n += nn
}
if size < 0 {
return n, errors.New("array length less than zero")
}
for i := 0; i < int(size); i++ {
var elem packet.Int
if nn, err := elem.ReadFrom(r); err != nil {
return n, err
} else {
n += nn
}
*a = append(*a, int32(elem))
}
return n, err
}
// Int32PrefixedArrayVarIntArray a utility type for encoding/decoding packet.Int -> int32[packet.VarInt] slice.
type Int32PrefixedArrayVarIntArray []int32
func (a Int32PrefixedArrayVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
if nn, err := packet.VarInt(size).WriteTo(w); err != nil {
return n, err
} else {
n += nn
}
for i := 0; i < size; i++ {
nn, err := packet.Int(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *Int32PrefixedArrayVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
if nn, err := size.ReadFrom(r); err != nil {
return nn, err
} else {
n += nn
}
if size < 0 {
return n, errors.New("array length less than zero")
}
for i := 0; i < int(size); i++ {
var elem packet.Int
if nn, err := elem.ReadFrom(r); err != nil {
return n, err
} else {
n += nn
}
*a = append(*a, int32(elem))
}
return n, err
}
// StringVarIntArray a utility type for encoding/decoding packet.String -> string[packet.VarInt] slice.
type StringVarIntArray []string
@ -3822,6 +3734,94 @@ func (a *Int32VarIntVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
return n, err
}
// Int32VarIntArray a utility type for encoding/decoding packet.Int -> int32[packet.VarInt] slice.
type Int32VarIntArray []int32
func (a Int32VarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
if nn, err := packet.VarInt(size).WriteTo(w); err != nil {
return n, err
} else {
n += nn
}
for i := 0; i < size; i++ {
nn, err := packet.Int(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *Int32VarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
if nn, err := size.ReadFrom(r); err != nil {
return nn, err
} else {
n += nn
}
if size < 0 {
return n, errors.New("array length less than zero")
}
for i := 0; i < int(size); i++ {
var elem packet.Int
if nn, err := elem.ReadFrom(r); err != nil {
return n, err
} else {
n += nn
}
*a = append(*a, int32(elem))
}
return n, err
}
// Int32PrefixedArrayVarIntArray a utility type for encoding/decoding packet.Int -> int32[packet.VarInt] slice.
type Int32PrefixedArrayVarIntArray []int32
func (a Int32PrefixedArrayVarIntArray) WriteTo(w io.Writer) (n int64, err error) {
size := len(a)
if nn, err := packet.VarInt(size).WriteTo(w); err != nil {
return n, err
} else {
n += nn
}
for i := 0; i < size; i++ {
nn, err := packet.Int(a[i]).WriteTo(w)
n += nn
if err != nil {
return n, err
}
}
return n, nil
}
func (a *Int32PrefixedArrayVarIntArray) ReadFrom(r io.Reader) (n int64, err error) {
var size packet.VarInt
if nn, err := size.ReadFrom(r); err != nil {
return nn, err
} else {
n += nn
}
if size < 0 {
return n, errors.New("array length less than zero")
}
for i := 0; i < int(size); i++ {
var elem packet.Int
if nn, err := elem.ReadFrom(r); err != nil {
return n, err
} else {
n += nn
}
*a = append(*a, int32(elem))
}
return n, err
}
// Float32VarIntArray a utility type for encoding/decoding packet.Float -> float32[packet.VarInt] slice.
type Float32VarIntArray []float32

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
package client
import "git.konjactw.dev/patyhank/minego/codec/particle"
//codec:gen
type Particle struct {
LongDistance bool
AlwaysVisible bool
X, Y, Z float64
OffsetX, OffsetY, OffsetZ float32
MaxSpeed float32
Count int32
Particle particle.Particle
}

View File

@ -2,6 +2,7 @@ package client
import "github.com/Tnze/go-mc/chat"
//codec:gen
type OpenScreen struct {
WindowID int32 `mc:"VarInt"`
WindowType int32 `mc:"VarInt"`

View File

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

View File

@ -1 +1,9 @@
package client
//codec:gen
type ResetScore struct {
EntityName string
HasObjectiveName bool
//opt:optional:HasObjectiveName
ObjectiveName string
}

View File

@ -5,7 +5,7 @@ import (
)
//codec:gen
type RemoveResourcePacket struct {
type RemoveResourcePack struct {
HasUUID bool
//opt:optional:HasUUID
UUID uuid.UUID `mc:"UUID"`

View File

@ -1,5 +1,6 @@
package client
//codec:gen
type SetBorderLerpSize struct {
OldDiameter, NewDiameter float64
Speed int64 `mc:"VarLong"`

View File

@ -1,5 +1,6 @@
package client
//codec:gen
type SetEntityVelocity struct {
EntityID int32 `mc:"VarInt"`
VelocityX, VelocityY, VelocityZ int16

View File

@ -4,6 +4,7 @@ import (
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type ShowDialog struct {
DialogID int32 `mc:"VarInt"`
//opt:id:DialogID

View File

@ -2,6 +2,7 @@ package client
import "github.com/Tnze/go-mc/chat"
//codec:gen
type SetTabListHeaderAndFooter struct {
Header chat.Message
Footer chat.Message

View File

@ -1,5 +1,6 @@
package client
//codec:gen
type SynchronizeVehiclePosition struct {
EntityID int32 `mc:"VarInt"`
X, Y, Z float64

View File

@ -36,6 +36,7 @@ type Advancement struct {
SendTelemetryData bool
}
//codec:gen
type AdvancementProgress struct {
ID string `mc:"Identifier"`
CriterionId string `mc:"Identifier"`

View File

@ -1,15 +1,18 @@
package client
//codec:gen
type Tag struct {
Name string `mc:"Identifier"`
Entries []int32 `mc:"VarInt"`
}
//codec:gen
type RegistryTag struct {
Registry string `mc:"Identifier"`
Tags []Tag
}
//codec:gen
type UpdateTags struct {
Data []RegistryTag
}

View File

@ -12,14 +12,17 @@ type WaypointVec3i struct {
X, Y, Z int32 `mc:"VarInt"`
}
//codec:gen
type WaypointChunkPos struct {
X, Z int32 `mc:"VarInt"`
}
//codec:gen
type WaypointAzimuth struct {
Angle float32
}
//codec:gen
type Waypoint struct {
Operation int32 `mc:"VarInt"`
IsUUIDIdentifier bool

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type AcceptTeleportation struct {
TeleportID int32 `mc:"VarInt"`
}
func (AcceptTeleportation) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundAcceptTeleportation
}
func init() {
registerPacket(packetid.ServerboundAcceptTeleportation, func() ServerboundPacket {
return &AcceptTeleportation{}
})
}

View File

@ -0,0 +1,22 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type BlockEntityTagQuery struct {
TransactionID int32 `mc:"VarInt"`
Location pk.Position
}
func (BlockEntityTagQuery) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundBlockEntityTagQuery
}
func init() {
registerPacket(packetid.ServerboundBlockEntityTagQuery, func() ServerboundPacket {
return &BlockEntityTagQuery{}
})
}

View File

@ -0,0 +1,19 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type BundleItemSelected struct {
SlotOfBundle int32 `mc:"VarInt"`
SlotInBundle int32 `mc:"VarInt"`
}
func (BundleItemSelected) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundBundleItemSelected
}
func init() {
registerPacket(packetid.ServerboundBundleItemSelected, func() ServerboundPacket {
return &BundleItemSelected{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ChangeDifficulty struct {
Difficulty uint8
}
func (ChangeDifficulty) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChangeDifficulty
}
func init() {
registerPacket(packetid.ServerboundChangeDifficulty, func() ServerboundPacket {
return &ChangeDifficulty{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ChangeGameMode struct {
GameMode int32 `mc:"VarInt"`
}
func (ChangeGameMode) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChangeGameMode
}
func init() {
registerPacket(packetid.ServerboundChangeGameMode, func() ServerboundPacket {
return &ChangeGameMode{}
})
}

View File

@ -0,0 +1,29 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type Chat struct {
Message string
Timestamp int64
Salt int64
HasSignature bool
//opt:optional:HasSignature
Signature []byte `mc:"ByteArray"`
MessageCount int32 `mc:"VarInt"`
Acknowledged pk.FixedBitSet `mc:"FixedBitSet" size:"20"`
Checksum int8
}
func (Chat) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChat
}
func init() {
registerPacket(packetid.ServerboundChat, func() ServerboundPacket {
return &Chat{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ChatAck struct {
MessageCount int32 `mc:"VarInt"`
}
func (ChatAck) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChatAck
}
func init() {
registerPacket(packetid.ServerboundChatAck, func() ServerboundPacket {
return &ChatAck{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ChatCommand struct {
Command string
}
func (ChatCommand) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChatCommand
}
func init() {
registerPacket(packetid.ServerboundChatCommand, func() ServerboundPacket {
return &ChatCommand{}
})
}

View File

@ -0,0 +1,33 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type SignedSignatures struct {
ArgumentName string
Signature []byte `mc:"ByteArray"`
}
//codec:gen
type ChatCommandSigned struct {
Command string
Timestamp int64
Salt int64
ArgumentSignatures []SignedSignatures
MessageCount int32 `mc:"VarInt"`
Acknowledged pk.FixedBitSet `mc:"FixedBitSet" size:"20"`
Checksum int8
}
func (ChatCommandSigned) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChatCommandSigned
}
func init() {
registerPacket(packetid.ServerboundChatCommandSigned, func() ServerboundPacket {
return &ChatCommandSigned{}
})
}

View File

@ -0,0 +1,23 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
"github.com/Tnze/go-mc/yggdrasil/user"
"github.com/google/uuid"
)
//codec:gen
type ChatSessionUpdate struct {
SessionId uuid.UUID `mc:"UUID"`
PublicKey user.PublicKey
}
func (ChatSessionUpdate) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChatSessionUpdate
}
func init() {
registerPacket(packetid.ServerboundChatSessionUpdate, func() ServerboundPacket {
return &ChatSessionUpdate{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ChunkBatchReceived struct {
ChunksPerTick float32
}
func (ChunkBatchReceived) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundChunkBatchReceived
}
func init() {
registerPacket(packetid.ServerboundChunkBatchReceived, func() ServerboundPacket {
return &ChunkBatchReceived{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ClientCommand struct {
Action int32 `mc:"VarInt"`
}
func (ClientCommand) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundClientCommand
}
func init() {
registerPacket(packetid.ServerboundClientCommand, func() ServerboundPacket {
return &ClientCommand{}
})
}

View File

@ -0,0 +1,26 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ClientInformation struct {
Location string
ViewDistance int8
ChatMode int32 `mc:"VarInt"`
ChatColor bool
DisplayedSkinParts uint8
MainHand int32 `mc:"VarInt"`
EnableTextFiltering bool
AllowListing bool
ParticleStatus int32 `mc:"VarInt"`
}
func (ClientInformation) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundClientInformation
}
func init() {
registerPacket(packetid.ServerboundClientInformation, func() ServerboundPacket {
return &ClientInformation{}
})
}

View File

@ -0,0 +1,17 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ClientTickEnd struct {
}
func (ClientTickEnd) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundClientTickEnd
}
func init() {
registerPacket(packetid.ServerboundClientTickEnd, func() ServerboundPacket {
return &ClientTickEnd{}
})
}

View File

@ -0,0 +1,19 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type CommandSuggestion struct {
TransactionID int32 `mc:"VarInt"`
Text string
}
func (CommandSuggestion) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundCommandSuggestion
}
func init() {
registerPacket(packetid.ServerboundCommandSuggestion, func() ServerboundPacket {
return &CommandSuggestion{}
})
}

View File

@ -0,0 +1,17 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ConfigurationAcknowledged struct {
}
func (ConfigurationAcknowledged) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundConfigurationAcknowledged
}
func init() {
registerPacket(packetid.ServerboundConfigurationAcknowledged, func() ServerboundPacket {
return &ConfigurationAcknowledged{}
})
}

View File

@ -0,0 +1,19 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ContainerButtonClick struct {
WindowID int32 `mc:"VarInt"`
ButtonID int32 `mc:"VarInt"`
}
func (ContainerButtonClick) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundContainerButtonClick
}
func init() {
registerPacket(packetid.ServerboundContainerButtonClick, func() ServerboundPacket {
return &ContainerButtonClick{}
})
}

View File

@ -0,0 +1,33 @@
package server
import (
"git.konjactw.dev/patyhank/minego/codec/slot"
"github.com/Tnze/go-mc/data/packetid"
)
//codec:gen
type ChangedSlot struct {
Slot int16
SlotData slot.HashedSlot
}
//codec:gen
type ContainerClick struct {
WindowID int32 `mc:"VarInt"`
StateID int32 `mc:"VarInt"`
Slot int16
Button int8
Mode int32 `mc:"VarInt"`
ChangedSlots []ChangedSlot
CarriedSlot slot.HashedSlot
}
func (ContainerClick) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundContainerClick
}
func init() {
registerPacket(packetid.ServerboundContainerClick, func() ServerboundPacket {
return &ContainerClick{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ContainerClose struct {
WindowID int32 `mc:"VarInt"`
}
func (ContainerClose) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundContainerClose
}
func init() {
registerPacket(packetid.ServerboundContainerClose, func() ServerboundPacket {
return &ContainerClose{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type ContainerSlotStateChanged struct {
SlotID int32 `mc:"VarInt"`
WindowID int32 `mc:"VarInt"`
State bool
}
func (ContainerSlotStateChanged) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundContainerSlotStateChanged
}
func init() {
registerPacket(packetid.ServerboundContainerSlotStateChanged, func() ServerboundPacket {
return &ContainerSlotStateChanged{}
})
}

View File

@ -0,0 +1,21 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type CookieResponse struct {
Key string `mc:"Identifier"`
HasPayload bool
//opt:optional:HasPayload
Payload []int8 `mc:"Byte"`
}
func (CookieResponse) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundCookieResponse
}
func init() {
registerPacket(packetid.ServerboundCookieResponse, func() ServerboundPacket {
return &CookieResponse{}
})
}

View File

@ -0,0 +1,22 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
"github.com/Tnze/go-mc/nbt"
)
//codec:gen
type CustomClickAction struct {
ID string `mc:"Identifier"`
Payload nbt.RawMessage `mc:"NBT"`
}
func (CustomClickAction) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundCustomClickAction
}
func init() {
registerPacket(packetid.ServerboundCustomClickAction, func() ServerboundPacket {
return &CustomClickAction{}
})
}

View File

@ -0,0 +1,19 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type CustomPayload struct {
Channel string `mc:"Identifier"`
Data []byte `mc:"ByteArray"`
}
func (CustomPayload) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundCustomPayload
}
func init() {
registerPacket(packetid.ServerboundCustomPayload, func() ServerboundPacket {
return &CustomPayload{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type DebugSampleSubscription struct {
SampleType int32 `mc:"VarInt"`
}
func (DebugSampleSubscription) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundDebugSampleSubscription
}
func init() {
registerPacket(packetid.ServerboundDebugSampleSubscription, func() ServerboundPacket {
return &DebugSampleSubscription{}
})
}

View File

@ -0,0 +1,22 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type EditBook struct {
Slot int32 `mc:"VarInt"`
Entries []string
HasTitle bool
//opt:optional:HasTitle
Title string
}
func (EditBook) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundEditBook
}
func init() {
registerPacket(packetid.ServerboundEditBook, func() ServerboundPacket {
return &EditBook{}
})
}

View File

@ -0,0 +1,19 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type EntityTagQuery struct {
TransactionID int32 `mc:"VarInt"`
EntityID int32 `mc:"VarInt"`
}
func (EntityTagQuery) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundEntityTagQuery
}
func init() {
registerPacket(packetid.ServerboundEntityTagQuery, func() ServerboundPacket {
return &EntityTagQuery{}
})
}

View File

@ -0,0 +1,28 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
)
//codec:gen
type Interact struct {
EntityID int32 `mc:"VarInt"`
Type int32 `mc:"VarInt"`
//opt:enum:Type:0
InteractHand int32 `mc:"VarInt"`
//opt:enum:Type:2
InteractAtTargetX, InteractAtTargetY, InteractAtTargetZ float32
//opt:enum:Type:2
InteractAtHand int32 `mc:"VarInt"`
SneakKeyPressed bool
}
func (Interact) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundInteract
}
func init() {
registerPacket(packetid.ServerboundInteract, func() ServerboundPacket {
return &Interact{}
})
}

View File

@ -0,0 +1,23 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type JigsawGenerate struct {
Location pk.Position
Levels int32 `mc:"VarInt"`
KeepJigsaws bool
}
func (JigsawGenerate) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundJigsawGenerate
}
func init() {
registerPacket(packetid.ServerboundJigsawGenerate, func() ServerboundPacket {
return &JigsawGenerate{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type KeepAlive struct {
ID int64
}
func (KeepAlive) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundKeepAlive
}
func init() {
registerPacket(packetid.ServerboundKeepAlive, func() ServerboundPacket {
return &KeepAlive{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type LockDifficulty struct {
Locked bool
}
func (LockDifficulty) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundLockDifficulty
}
func init() {
registerPacket(packetid.ServerboundLockDifficulty, func() ServerboundPacket {
return &LockDifficulty{}
})
}

View File

@ -0,0 +1,19 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type MovePlayerPos struct {
X, FeetY, Z float64
Flags int8
}
func (MovePlayerPos) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMovePlayerPos
}
func init() {
registerPacket(packetid.ServerboundMovePlayerPos, func() ServerboundPacket {
return &MovePlayerPos{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type MovePlayerPosRot struct {
X, FeetY, Z float64
Yaw, Pitch float32
Flags int8
}
func (MovePlayerPosRot) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMovePlayerPosRot
}
func init() {
registerPacket(packetid.ServerboundMovePlayerPosRot, func() ServerboundPacket {
return &MovePlayerPosRot{}
})
}

View File

@ -0,0 +1,19 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type MovePlayerRot struct {
Yaw, Pitch float32
Flags int8
}
func (MovePlayerRot) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMovePlayerRot
}
func init() {
registerPacket(packetid.ServerboundMovePlayerRot, func() ServerboundPacket {
return &MovePlayerRot{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type MovePlayerStatusOnly struct {
Flags int8
}
func (MovePlayerStatusOnly) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMovePlayerStatusOnly
}
func init() {
registerPacket(packetid.ServerboundMovePlayerStatusOnly, func() ServerboundPacket {
return &MovePlayerStatusOnly{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type MoveVehicle struct {
X, Y, Z float64
Yaw, Pitch float32
OnGround bool
}
func (MoveVehicle) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundMoveVehicle
}
func init() {
registerPacket(packetid.ServerboundMoveVehicle, func() ServerboundPacket {
return &MoveVehicle{}
})
}

View File

@ -1,10 +1,20 @@
//codec:ignore
package server
import "github.com/Tnze/go-mc/data/packetid"
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
type ServerboundPacket interface {
ServerboundPacketID() packetid.ServerboundPacketID
pk.Field
PacketID() packetid.ServerboundPacketID
}
var ServerboundPackets = make(map[packetid.ServerboundPacketID]ServerboundPacket)
type serverPacketCreator func() ServerboundPacket
var packetRegistry = make(map[packetid.ServerboundPacketID]serverPacketCreator)
func registerPacket(id packetid.ServerboundPacketID, creator serverPacketCreator) {
packetRegistry[id] = creator
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type PaddleBoat struct {
LeftTurning, RightTurning bool
}
func (PaddleBoat) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPaddleBoat
}
func init() {
registerPacket(packetid.ServerboundPaddleBoat, func() ServerboundPacket {
return &PaddleBoat{}
})
}

View File

@ -0,0 +1,22 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type PickItemFromBlock struct {
Location pk.Position
IncludeData bool
}
func (PickItemFromBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPickItemFromBlock
}
func init() {
registerPacket(packetid.ServerboundPickItemFromBlock, func() ServerboundPacket {
return &PickItemFromBlock{}
})
}

View File

@ -0,0 +1,19 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type PickItemFromEntity struct {
EntityID int32 `mc:"VarInt"`
IncludeData bool
}
func (PickItemFromEntity) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPickItemFromEntity
}
func init() {
registerPacket(packetid.ServerboundPickItemFromEntity, func() ServerboundPacket {
return &PickItemFromEntity{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type PingRequest struct {
payload int64
}
func (PingRequest) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPingRequest
}
func init() {
registerPacket(packetid.ServerboundPingRequest, func() ServerboundPacket {
return &PingRequest{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type PlaceRecipe struct {
WindowID int32 `mc:"VarInt"`
RecipeID int32 `mc:"VarInt"`
MakeAll bool
}
func (PlaceRecipe) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlaceRecipe
}
func init() {
registerPacket(packetid.ServerboundPlaceRecipe, func() ServerboundPacket {
return &PlaceRecipe{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type PlayerAbilities struct {
Flags int8
}
func (PlayerAbilities) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerAbilities
}
func init() {
registerPacket(packetid.ServerboundPlayerAbilities, func() ServerboundPacket {
return &PlayerAbilities{}
})
}

View File

@ -0,0 +1,24 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type PlayerAction struct {
Status int32 `mc:"VarInt"`
Location pk.Position
Face int8
Sequence int32 `mc:"VarInt"`
}
func (PlayerAction) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerAction
}
func init() {
registerPacket(packetid.ServerboundPlayerAction, func() ServerboundPacket {
return &PlayerAction{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type PlayerCommand struct {
EntityID int32 `mc:"VarInt"`
ActionID int32 `mc:"VarInt"`
JumpBoost int32 `mc:"VarInt"`
}
func (PlayerCommand) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerCommand
}
func init() {
registerPacket(packetid.ServerboundPlayerCommand, func() ServerboundPacket {
return &PlayerCommand{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type PlayerInput struct {
Flags uint8
}
func (PlayerInput) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerInput
}
func init() {
registerPacket(packetid.ServerboundPlayerInput, func() ServerboundPacket {
return &PlayerInput{}
})
}

View File

@ -0,0 +1,17 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type PlayerLoaded struct {
}
func (PlayerLoaded) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPlayerLoaded
}
func init() {
registerPacket(packetid.ServerboundPlayerLoaded, func() ServerboundPacket {
return &PlayerLoaded{}
})
}

View File

@ -0,0 +1,17 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type Pong struct {
}
func (Pong) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundPong
}
func init() {
registerPacket(packetid.ServerboundPong, func() ServerboundPacket {
return &Pong{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type RecipeBookChangeSettings struct {
BookId int32 `mc:"VarInt"`
BookOpen bool
FilterActive bool
}
func (RecipeBookChangeSettings) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundRecipeBookChangeSettings
}
func init() {
registerPacket(packetid.ServerboundRecipeBookChangeSettings, func() ServerboundPacket {
return &RecipeBookChangeSettings{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type RecipeBookSeenRecipe struct {
RecipeID int32 `mc:"VarInt"`
}
func (RecipeBookSeenRecipe) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundRecipeBookSeenRecipe
}
func init() {
registerPacket(packetid.ServerboundRecipeBookSeenRecipe, func() ServerboundPacket {
return &RecipeBookSeenRecipe{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type RenameItem struct {
ItemName string
}
func (RenameItem) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundRenameItem
}
func init() {
registerPacket(packetid.ServerboundRenameItem, func() ServerboundPacket {
return &RenameItem{}
})
}

View File

@ -0,0 +1,22 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
"github.com/google/uuid"
)
//codec:gen
type ResourcePack struct {
UUID uuid.UUID `mc:"UUID"`
Result int32 `mc:"VarInt"`
}
func (ResourcePack) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundResourcePack
}
func init() {
registerPacket(packetid.ServerboundResourcePack, func() ServerboundPacket {
return &ResourcePack{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type SeenAdvancements struct {
Action int32 `mc:"VarInt"`
//opt:enum:Action:0
TabID string `mc:"Identifier"`
}
func (SeenAdvancements) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSeenAdvancements
}
func init() {
registerPacket(packetid.ServerboundSeenAdvancements, func() ServerboundPacket {
return &SeenAdvancements{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type SelectTrade struct {
SelectedSlot int32 `mc:"VarInt"`
}
func (SelectTrade) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSelectTrade
}
func init() {
registerPacket(packetid.ServerboundSelectTrade, func() ServerboundPacket {
return &SelectTrade{}
})
}

View File

@ -0,0 +1,23 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type SetBeacon struct {
HasPrimaryEffect bool
//opt:optional:HasPrimaryEffect
PrimaryEffect int32 `mc:"VarInt"`
HasSecondaryEffect bool
//opt:optional:HasSecondaryEffect
SecondaryEffect int32 `mc:"VarInt"`
}
func (SetBeacon) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetBeacon
}
func init() {
registerPacket(packetid.ServerboundSetBeacon, func() ServerboundPacket {
return &SetBeacon{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type SetCarriedItem struct {
Slot int16
}
func (SetCarriedItem) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetCarriedItem
}
func init() {
registerPacket(packetid.ServerboundSetCarriedItem, func() ServerboundPacket {
return &SetCarriedItem{}
})
}

View File

@ -0,0 +1,24 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type SetCommandBlock struct {
Location pk.Position
Command string
Mode int32 `mc:"VarInt"`
Flags int8
}
func (SetCommandBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetCommandBlock
}
func init() {
registerPacket(packetid.ServerboundSetCommandBlock, func() ServerboundPacket {
return &SetCommandBlock{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type SetCommandMinecart struct {
EntityID int32 `mc:"VarInt"`
Command string
TrackOutput bool
}
func (SetCommandMinecart) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetCommandMinecart
}
func init() {
registerPacket(packetid.ServerboundSetCommandMinecart, func() ServerboundPacket {
return &SetCommandMinecart{}
})
}

View File

@ -0,0 +1,22 @@
package server
import (
"git.konjactw.dev/patyhank/minego/codec/slot"
"github.com/Tnze/go-mc/data/packetid"
)
//codec:gen
type SetCreativeModeSlot struct {
Slot int16
ClickedItem slot.Slot
}
func (SetCreativeModeSlot) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetCreativeModeSlot
}
func init() {
registerPacket(packetid.ServerboundSetCreativeModeSlot, func() ServerboundPacket {
return &SetCreativeModeSlot{}
})
}

View File

@ -0,0 +1,28 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type SetJigsawBlock struct {
Location pk.Position
Name string `mc:"Identifier"`
Target string `mc:"Identifier"`
Pool string `mc:"Identifier"`
FinalState string
JointType string
SelectionPriority int32 `mc:"VarInt"`
PlacementPriority int32 `mc:"VarInt"`
}
func (SetJigsawBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetJigsawBlock
}
func init() {
registerPacket(packetid.ServerboundSetJigsawBlock, func() ServerboundPacket {
return &SetJigsawBlock{}
})
}

View File

@ -0,0 +1,32 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type SetStructureBlock struct {
Location pk.Position
Action int32 `mc:"VarInt"`
Mode int32 `mc:"VarInt"`
Name string
OffsetX, OffsetY, OffsetZ int8
SizeX, SizeY, SizeZ int8
Mirror int32 `mc:"VarInt"`
Rotation int32 `mc:"VarInt"`
Metadata string
Integrity float32
Seed int32 `mc:"VarLong"`
Flags int8
}
func (SetStructureBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetStructureBlock
}
func init() {
registerPacket(packetid.ServerboundSetStructureBlock, func() ServerboundPacket {
return &SetStructureBlock{}
})
}

View File

@ -0,0 +1,23 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type SetTestBlock struct {
Position pk.Position
Mode int32 `mc:"VarInt"`
Message string
}
func (SetTestBlock) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSetTestBlock
}
func init() {
registerPacket(packetid.ServerboundSetTestBlock, func() ServerboundPacket {
return &SetTestBlock{}
})
}

View File

@ -0,0 +1,23 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type SignUpdate struct {
Location pk.Position
IsFrontText bool
Line1, Line2, Line3, Line4 string
}
func (SignUpdate) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSignUpdate
}
func init() {
registerPacket(packetid.ServerboundSignUpdate, func() ServerboundPacket {
return &SignUpdate{}
})
}

View File

@ -0,0 +1,18 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type Swing struct {
Hand int32 `mc:"VarInt"`
}
func (Swing) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundSwing
}
func init() {
registerPacket(packetid.ServerboundSwing, func() ServerboundPacket {
return &Swing{}
})
}

View File

@ -0,0 +1,21 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
"github.com/google/uuid"
)
//codec:gen
type TeleportToEntity struct {
TargetPlayer uuid.UUID `mc:"UUID"`
}
func (TeleportToEntity) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundTeleportToEntity
}
func init() {
registerPacket(packetid.ServerboundTeleportToEntity, func() ServerboundPacket {
return &TeleportToEntity{}
})
}

View File

@ -0,0 +1,33 @@
package server
import (
"github.com/Tnze/go-mc/chat"
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type TestInstanceBlockAction struct {
Position pk.Position
Action int32 `mc:"VarInt"`
IsTest bool
//opt:optional:IsTest
Test int32 `mc:"VarInt"`
SizeX, SizeY, SizeZ int32 `mc:"VarInt"`
Rotation int32 `mc:"VarInt"`
IgnoredEntities bool
Status int32 `mc:"VarInt"`
HasErrorMessage bool
//opt:optional:HasErrorMessage
ErrorMessage chat.Message
}
func (TestInstanceBlockAction) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundTestInstanceBlockAction
}
func init() {
registerPacket(packetid.ServerboundTestInstanceBlockAction, func() ServerboundPacket {
return &TestInstanceBlockAction{}
})
}

View File

@ -0,0 +1,20 @@
package server
import "github.com/Tnze/go-mc/data/packetid"
//codec:gen
type UseItem struct {
Hand int32 `mc:"VarInt"`
Sequence int32 `mc:"VarInt"`
Yaw, Pitch float32
}
func (UseItem) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundUseItem
}
func init() {
registerPacket(packetid.ServerboundUseItem, func() ServerboundPacket {
return &UseItem{}
})
}

View File

@ -0,0 +1,27 @@
package server
import (
"github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet"
)
//codec:gen
type UseItemOn struct {
Hand int32 `mc:"VarInt"`
Location pk.Position
Face int32 `mc:"VarInt"`
CursorX, CursorY, CursorZ float32
InsideBlock bool
WorldBorderHit bool
Sequence int32 `mc:"VarInt"`
}
func (UseItemOn) PacketID() packetid.ServerboundPacketID {
return packetid.ServerboundUseItemOn
}
func init() {
registerPacket(packetid.ServerboundUseItemOn, func() ServerboundPacket {
return &UseItemOn{}
})
}

20
codec/slot/hashed_item.go Normal file
View File

@ -0,0 +1,20 @@
package slot
//codec:gen
type AddedHashedComponent struct {
Type int32 `mc:"VarInt"`
DataHash int32
}
//codec:gen
type HashedSlot struct {
HasItem bool
//opt:optional:HasItem
ItemID int32 `mc:"VarInt"`
//opt:optional:HasItem
ItemCount int32 `mc:"VarInt"`
//opt:optional:HasItem
AddComponents AddedHashedComponent
//opt:optional:HasItem
RemovedComponents []int32 `mc:"VarInt"`
}