refactor package
This commit is contained in:
18
pkg/protocol/packet/game/server/accept_teleportation.go
Normal file
18
pkg/protocol/packet/game/server/accept_teleportation.go
Normal 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{}
|
||||
})
|
||||
}
|
22
pkg/protocol/packet/game/server/block_entity_tag_query.go
Normal file
22
pkg/protocol/packet/game/server/block_entity_tag_query.go
Normal 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{}
|
||||
})
|
||||
}
|
19
pkg/protocol/packet/game/server/bundle_item_selected.go
Normal file
19
pkg/protocol/packet/game/server/bundle_item_selected.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/change_difficulty.go
Normal file
18
pkg/protocol/packet/game/server/change_difficulty.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/change_game_mode.go
Normal file
18
pkg/protocol/packet/game/server/change_game_mode.go
Normal 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{}
|
||||
})
|
||||
}
|
29
pkg/protocol/packet/game/server/chat.go
Normal file
29
pkg/protocol/packet/game/server/chat.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/chat_ack.go
Normal file
18
pkg/protocol/packet/game/server/chat_ack.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/chat_command.go
Normal file
18
pkg/protocol/packet/game/server/chat_command.go
Normal 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{}
|
||||
})
|
||||
}
|
33
pkg/protocol/packet/game/server/chat_command_signed.go
Normal file
33
pkg/protocol/packet/game/server/chat_command_signed.go
Normal 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{}
|
||||
})
|
||||
}
|
23
pkg/protocol/packet/game/server/chat_session_update.go
Normal file
23
pkg/protocol/packet/game/server/chat_session_update.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/chunk_batch_received.go
Normal file
18
pkg/protocol/packet/game/server/chunk_batch_received.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/client_command.go
Normal file
18
pkg/protocol/packet/game/server/client_command.go
Normal 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{}
|
||||
})
|
||||
}
|
26
pkg/protocol/packet/game/server/client_information.go
Normal file
26
pkg/protocol/packet/game/server/client_information.go
Normal 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{}
|
||||
})
|
||||
}
|
17
pkg/protocol/packet/game/server/client_tick_end.go
Normal file
17
pkg/protocol/packet/game/server/client_tick_end.go
Normal 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{}
|
||||
})
|
||||
}
|
2825
pkg/protocol/packet/game/server/codecs.go
Normal file
2825
pkg/protocol/packet/game/server/codecs.go
Normal file
File diff suppressed because it is too large
Load Diff
19
pkg/protocol/packet/game/server/command_suggestion.go
Normal file
19
pkg/protocol/packet/game/server/command_suggestion.go
Normal 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{}
|
||||
})
|
||||
}
|
@ -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{}
|
||||
})
|
||||
}
|
19
pkg/protocol/packet/game/server/container_button_click.go
Normal file
19
pkg/protocol/packet/game/server/container_button_click.go
Normal 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{}
|
||||
})
|
||||
}
|
33
pkg/protocol/packet/game/server/container_click.go
Normal file
33
pkg/protocol/packet/game/server/container_click.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/container_close.go
Normal file
18
pkg/protocol/packet/game/server/container_close.go
Normal 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{}
|
||||
})
|
||||
}
|
@ -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{}
|
||||
})
|
||||
}
|
21
pkg/protocol/packet/game/server/cookie_response.go
Normal file
21
pkg/protocol/packet/game/server/cookie_response.go
Normal 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{}
|
||||
})
|
||||
}
|
22
pkg/protocol/packet/game/server/custom_click_action.go
Normal file
22
pkg/protocol/packet/game/server/custom_click_action.go
Normal 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{}
|
||||
})
|
||||
}
|
19
pkg/protocol/packet/game/server/custom_payload.go
Normal file
19
pkg/protocol/packet/game/server/custom_payload.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/debug_sample_subscription.go
Normal file
18
pkg/protocol/packet/game/server/debug_sample_subscription.go
Normal 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{}
|
||||
})
|
||||
}
|
22
pkg/protocol/packet/game/server/edit_book.go
Normal file
22
pkg/protocol/packet/game/server/edit_book.go
Normal 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{}
|
||||
})
|
||||
}
|
19
pkg/protocol/packet/game/server/entity_tag_query.go
Normal file
19
pkg/protocol/packet/game/server/entity_tag_query.go
Normal 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{}
|
||||
})
|
||||
}
|
28
pkg/protocol/packet/game/server/interact.go
Normal file
28
pkg/protocol/packet/game/server/interact.go
Normal 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{}
|
||||
})
|
||||
}
|
23
pkg/protocol/packet/game/server/jigsaw_generate.go
Normal file
23
pkg/protocol/packet/game/server/jigsaw_generate.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/keep_alive.go
Normal file
18
pkg/protocol/packet/game/server/keep_alive.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/lock_difficulty.go
Normal file
18
pkg/protocol/packet/game/server/lock_difficulty.go
Normal 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{}
|
||||
})
|
||||
}
|
19
pkg/protocol/packet/game/server/move_player_pos.go
Normal file
19
pkg/protocol/packet/game/server/move_player_pos.go
Normal 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{}
|
||||
})
|
||||
}
|
20
pkg/protocol/packet/game/server/move_player_pos_rot.go
Normal file
20
pkg/protocol/packet/game/server/move_player_pos_rot.go
Normal 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{}
|
||||
})
|
||||
}
|
19
pkg/protocol/packet/game/server/move_player_rot.go
Normal file
19
pkg/protocol/packet/game/server/move_player_rot.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/move_player_status_only.go
Normal file
18
pkg/protocol/packet/game/server/move_player_status_only.go
Normal 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{}
|
||||
})
|
||||
}
|
20
pkg/protocol/packet/game/server/move_vehicle.go
Normal file
20
pkg/protocol/packet/game/server/move_vehicle.go
Normal 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{}
|
||||
})
|
||||
}
|
20
pkg/protocol/packet/game/server/packet.go
Normal file
20
pkg/protocol/packet/game/server/packet.go
Normal file
@ -0,0 +1,20 @@
|
||||
//codec:ignore
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/data/packetid"
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
)
|
||||
|
||||
type ServerboundPacket interface {
|
||||
pk.Field
|
||||
PacketID() packetid.ServerboundPacketID
|
||||
}
|
||||
|
||||
type serverPacketCreator func() ServerboundPacket
|
||||
|
||||
var packetRegistry = make(map[packetid.ServerboundPacketID]serverPacketCreator)
|
||||
|
||||
func registerPacket(id packetid.ServerboundPacketID, creator serverPacketCreator) {
|
||||
packetRegistry[id] = creator
|
||||
}
|
18
pkg/protocol/packet/game/server/paddle_boat.go
Normal file
18
pkg/protocol/packet/game/server/paddle_boat.go
Normal 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{}
|
||||
})
|
||||
}
|
22
pkg/protocol/packet/game/server/pick_item_from_block.go
Normal file
22
pkg/protocol/packet/game/server/pick_item_from_block.go
Normal 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{}
|
||||
})
|
||||
}
|
19
pkg/protocol/packet/game/server/pick_item_from_entity.go
Normal file
19
pkg/protocol/packet/game/server/pick_item_from_entity.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/ping_request.go
Normal file
18
pkg/protocol/packet/game/server/ping_request.go
Normal 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{}
|
||||
})
|
||||
}
|
20
pkg/protocol/packet/game/server/place_recipe.go
Normal file
20
pkg/protocol/packet/game/server/place_recipe.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/player_abilities.go
Normal file
18
pkg/protocol/packet/game/server/player_abilities.go
Normal 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{}
|
||||
})
|
||||
}
|
24
pkg/protocol/packet/game/server/player_action.go
Normal file
24
pkg/protocol/packet/game/server/player_action.go
Normal 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{}
|
||||
})
|
||||
}
|
20
pkg/protocol/packet/game/server/player_command.go
Normal file
20
pkg/protocol/packet/game/server/player_command.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/player_input.go
Normal file
18
pkg/protocol/packet/game/server/player_input.go
Normal 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{}
|
||||
})
|
||||
}
|
17
pkg/protocol/packet/game/server/player_loaded.go
Normal file
17
pkg/protocol/packet/game/server/player_loaded.go
Normal 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{}
|
||||
})
|
||||
}
|
17
pkg/protocol/packet/game/server/pong.go
Normal file
17
pkg/protocol/packet/game/server/pong.go
Normal 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{}
|
||||
})
|
||||
}
|
@ -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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/recipe_book_seen_recipe.go
Normal file
18
pkg/protocol/packet/game/server/recipe_book_seen_recipe.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/rename_item.go
Normal file
18
pkg/protocol/packet/game/server/rename_item.go
Normal 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{}
|
||||
})
|
||||
}
|
22
pkg/protocol/packet/game/server/resource_pack.go
Normal file
22
pkg/protocol/packet/game/server/resource_pack.go
Normal 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{}
|
||||
})
|
||||
}
|
20
pkg/protocol/packet/game/server/seen_advancements.go
Normal file
20
pkg/protocol/packet/game/server/seen_advancements.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/select_trade.go
Normal file
18
pkg/protocol/packet/game/server/select_trade.go
Normal 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{}
|
||||
})
|
||||
}
|
23
pkg/protocol/packet/game/server/set_beacon.go
Normal file
23
pkg/protocol/packet/game/server/set_beacon.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/set_carried_item.go
Normal file
18
pkg/protocol/packet/game/server/set_carried_item.go
Normal 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{}
|
||||
})
|
||||
}
|
24
pkg/protocol/packet/game/server/set_command_block.go
Normal file
24
pkg/protocol/packet/game/server/set_command_block.go
Normal 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{}
|
||||
})
|
||||
}
|
20
pkg/protocol/packet/game/server/set_command_minecart.go
Normal file
20
pkg/protocol/packet/game/server/set_command_minecart.go
Normal 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{}
|
||||
})
|
||||
}
|
22
pkg/protocol/packet/game/server/set_creative_mode_slot.go
Normal file
22
pkg/protocol/packet/game/server/set_creative_mode_slot.go
Normal file
@ -0,0 +1,22 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/pkg/protocol/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{}
|
||||
})
|
||||
}
|
28
pkg/protocol/packet/game/server/set_jigsaw_block.go
Normal file
28
pkg/protocol/packet/game/server/set_jigsaw_block.go
Normal 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{}
|
||||
})
|
||||
}
|
32
pkg/protocol/packet/game/server/set_structure_block.go
Normal file
32
pkg/protocol/packet/game/server/set_structure_block.go
Normal 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 int64 `mc:"VarLong"`
|
||||
Flags int8
|
||||
}
|
||||
|
||||
func (SetStructureBlock) PacketID() packetid.ServerboundPacketID {
|
||||
return packetid.ServerboundSetStructureBlock
|
||||
}
|
||||
|
||||
func init() {
|
||||
registerPacket(packetid.ServerboundSetStructureBlock, func() ServerboundPacket {
|
||||
return &SetStructureBlock{}
|
||||
})
|
||||
}
|
23
pkg/protocol/packet/game/server/set_test_block.go
Normal file
23
pkg/protocol/packet/game/server/set_test_block.go
Normal 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{}
|
||||
})
|
||||
}
|
23
pkg/protocol/packet/game/server/sign_update.go
Normal file
23
pkg/protocol/packet/game/server/sign_update.go
Normal 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{}
|
||||
})
|
||||
}
|
18
pkg/protocol/packet/game/server/swing.go
Normal file
18
pkg/protocol/packet/game/server/swing.go
Normal 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{}
|
||||
})
|
||||
}
|
21
pkg/protocol/packet/game/server/teleport_to_entity.go
Normal file
21
pkg/protocol/packet/game/server/teleport_to_entity.go
Normal 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{}
|
||||
})
|
||||
}
|
@ -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{}
|
||||
})
|
||||
}
|
20
pkg/protocol/packet/game/server/use_item.go
Normal file
20
pkg/protocol/packet/game/server/use_item.go
Normal 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{}
|
||||
})
|
||||
}
|
27
pkg/protocol/packet/game/server/use_item_on.go
Normal file
27
pkg/protocol/packet/game/server/use_item_on.go
Normal 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{}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user