1.21.6 Clientbound PlayState Packets
This commit is contained in:
5
codec/packet/game/client/clear_dialog.go
Normal file
5
codec/packet/game/client/clear_dialog.go
Normal file
@ -0,0 +1,5 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type ClearDialog struct {
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
package client
|
||||
|
||||
import "git.konjactw.dev/patyhank/minego/codec/data/slot"
|
||||
import "git.konjactw.dev/patyhank/minego/codec/slot"
|
||||
|
||||
//codec:gen
|
||||
type SetContainerContent struct {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/codec/data/slot"
|
||||
"git.konjactw.dev/patyhank/minego/codec/slot"
|
||||
"github.com/Tnze/go-mc/data/packetid"
|
||||
"github.com/Tnze/go-mc/net/packet"
|
||||
)
|
||||
|
12
codec/packet/game/client/custom_report_details.go
Normal file
12
codec/packet/game/client/custom_report_details.go
Normal file
@ -0,0 +1,12 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type ReportDetails struct {
|
||||
Title string
|
||||
Description string
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type CustomReportDetails struct {
|
||||
Details []ReportDetails
|
||||
}
|
@ -1 +1,31 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/codec/slot"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type TradeOption struct {
|
||||
Input slot.TradeSlot
|
||||
Output slot.Slot
|
||||
HasSecondInput bool
|
||||
//opt:optional:HasSecondInput
|
||||
SecondInput slot.TradeSlot
|
||||
TradeDisabled bool
|
||||
TradeUses int32
|
||||
MaxTradeUses int32
|
||||
Experience int32
|
||||
SpecialPrice int32
|
||||
PriceMultiplier float32
|
||||
Demand int32
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type MerchantOffers struct {
|
||||
WindowID int32 `mc:"VarInt"`
|
||||
Offers []TradeOption
|
||||
Level int32 `mc:"VarInt"`
|
||||
Experience int32 `mc:"VarInt"`
|
||||
IsRegular bool
|
||||
CanRestock bool
|
||||
}
|
||||
|
8
codec/packet/game/client/move_entity_pos.go
Normal file
8
codec/packet/game/client/move_entity_pos.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type UpdateEntityPosition struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
DeltaX, DeltaY, DeltaZ int16
|
||||
OnGround bool
|
||||
}
|
11
codec/packet/game/client/move_entity_pos_rot.go
Normal file
11
codec/packet/game/client/move_entity_pos_rot.go
Normal file
@ -0,0 +1,11 @@
|
||||
package client
|
||||
|
||||
import pk "github.com/Tnze/go-mc/net/packet"
|
||||
|
||||
//codec:gen
|
||||
type UpdateEntityPositionAndRotation struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
DeltaX, DeltaY, DeltaZ int16
|
||||
Yaw, Pitch pk.Angle
|
||||
OnGround bool
|
||||
}
|
8
codec/packet/game/client/move_entity_rot.go
Normal file
8
codec/packet/game/client/move_entity_rot.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type UpdateEntityRotation struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
Yaw, Pitch float32
|
||||
OnGround bool
|
||||
}
|
17
codec/packet/game/client/move_minecart_along_track.go
Normal file
17
codec/packet/game/client/move_minecart_along_track.go
Normal file
@ -0,0 +1,17 @@
|
||||
package client
|
||||
|
||||
import pk "github.com/Tnze/go-mc/net/packet"
|
||||
|
||||
//codec:gen
|
||||
type MinecartStep struct {
|
||||
X, Y, Z float64
|
||||
VelocityX, VelocityY, VelocityZ float64
|
||||
Yaw, Pitch pk.Angle
|
||||
Weight float32
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type MoveMinecartAlongTrack struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
Steps []MinecartStep
|
||||
}
|
7
codec/packet/game/client/move_vehicle.go
Normal file
7
codec/packet/game/client/move_vehicle.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type MoveVehicle struct {
|
||||
X, Y, Z float64
|
||||
Yaw, Pitch float32
|
||||
}
|
6
codec/packet/game/client/open_book.go
Normal file
6
codec/packet/game/client/open_book.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type OpenBook struct {
|
||||
Hand int32 `mc:"VarInt"`
|
||||
}
|
9
codec/packet/game/client/open_screen.go
Normal file
9
codec/packet/game/client/open_screen.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
type OpenScreen struct {
|
||||
WindowID int32 `mc:"VarInt"`
|
||||
WindowType int32 `mc:"VarInt"`
|
||||
WindowTitle chat.Message
|
||||
}
|
9
codec/packet/game/client/open_sign_editor.go
Normal file
9
codec/packet/game/client/open_sign_editor.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import pk "github.com/Tnze/go-mc/net/packet"
|
||||
|
||||
//codec:gen
|
||||
type OpenSignEditor struct {
|
||||
Location pk.Position
|
||||
Front bool
|
||||
}
|
6
codec/packet/game/client/ping.go
Normal file
6
codec/packet/game/client/ping.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type Ping struct {
|
||||
ID int32
|
||||
}
|
6
codec/packet/game/client/ping_response.go
Normal file
6
codec/packet/game/client/ping_response.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type PingResponse struct {
|
||||
Payload int64
|
||||
}
|
9
codec/packet/game/client/place_ghost_recipe.go
Normal file
9
codec/packet/game/client/place_ghost_recipe.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import "git.konjactw.dev/patyhank/minego/codec/slot/display/recipe"
|
||||
|
||||
//codec:gen
|
||||
type PlaceGhostRecipe struct {
|
||||
WindowID int32 `mc:"VarInt"`
|
||||
RecipeDisplay recipe.Display
|
||||
}
|
@ -8,7 +8,7 @@ var _ ClientboundPacket = (*PlayerAbilities)(nil)
|
||||
|
||||
//codec:gen
|
||||
type PlayerAbilities struct {
|
||||
Flags uint8
|
||||
Flags int8
|
||||
FlyingSpeed float32
|
||||
WalkingSpeed float32
|
||||
}
|
||||
|
6
codec/packet/game/client/player_combat_end.go
Normal file
6
codec/packet/game/client/player_combat_end.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type EndCombat struct {
|
||||
Duration int32 `mc:"VarInt"`
|
||||
}
|
5
codec/packet/game/client/player_combat_enter.go
Normal file
5
codec/packet/game/client/player_combat_enter.go
Normal file
@ -0,0 +1,5 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type EnterCombat struct {
|
||||
}
|
9
codec/packet/game/client/player_combat_kill.go
Normal file
9
codec/packet/game/client/player_combat_kill.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
//codec:gen
|
||||
type CombatDeath struct {
|
||||
PlayerID int32 `mc:"VarInt"`
|
||||
Message chat.Message
|
||||
}
|
10
codec/packet/game/client/player_info_remove.go
Normal file
10
codec/packet/game/client/player_info_remove.go
Normal file
@ -0,0 +1,10 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoRemove struct {
|
||||
UUIDs []uuid.UUID `mc:"UUID"`
|
||||
}
|
224
codec/packet/game/client/player_info_update.go
Normal file
224
codec/packet/game/client/player_info_update.go
Normal file
@ -0,0 +1,224 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/chat"
|
||||
"github.com/Tnze/go-mc/chat/sign"
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
"github.com/Tnze/go-mc/yggdrasil/user"
|
||||
"github.com/google/uuid"
|
||||
"io"
|
||||
)
|
||||
|
||||
type PlayerInfo interface {
|
||||
pk.Field
|
||||
playerInfoBitMask() int
|
||||
}
|
||||
|
||||
type PlayerInfoUpdate struct {
|
||||
Players map[uuid.UUID][]PlayerInfo
|
||||
}
|
||||
|
||||
func (p PlayerInfoUpdate) WriteTo(w io.Writer) (n int64, err error) {
|
||||
bitset := pk.NewFixedBitSet(8)
|
||||
for _, infos := range p.Players {
|
||||
for _, info := range infos {
|
||||
bitset.Set(info.playerInfoBitMask(), true)
|
||||
}
|
||||
}
|
||||
n1, err := bitset.WriteTo(w)
|
||||
if err != nil {
|
||||
return n1, err
|
||||
}
|
||||
n += n1
|
||||
n2, err := pk.VarInt(len(p.Players)).WriteTo(w)
|
||||
if err != nil {
|
||||
return n1 + n2, err
|
||||
}
|
||||
n += n2
|
||||
for playerUUID, infos := range p.Players {
|
||||
n3, err := (*pk.UUID)(&playerUUID).WriteTo(w)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3, err
|
||||
}
|
||||
n += n3
|
||||
for _, info := range infos {
|
||||
n4, err := info.WriteTo(w)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
n += n4
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (p *PlayerInfoUpdate) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
bitset := pk.NewFixedBitSet(8)
|
||||
n1, err := bitset.ReadFrom(r)
|
||||
if err != nil {
|
||||
return n1, err
|
||||
}
|
||||
m := make(map[uuid.UUID][]PlayerInfo)
|
||||
|
||||
var playerLens pk.VarInt
|
||||
n2, err := playerLens.ReadFrom(r)
|
||||
if err != nil {
|
||||
return n1 + n2, err
|
||||
}
|
||||
for i := 0; i < int(playerLens); i++ {
|
||||
var playerUUID uuid.UUID
|
||||
n3, err := (*pk.UUID)(&playerUUID).ReadFrom(r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3, err
|
||||
}
|
||||
var temp int64
|
||||
var infos []PlayerInfo
|
||||
if bitset.Get(0x01) {
|
||||
n4, err := playerInfoRead(&infos, &PlayerInfoAddPlayer{}, r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
temp += n4
|
||||
}
|
||||
if bitset.Get(0x02) {
|
||||
n4, err := playerInfoRead(&infos, &PlayerInfoInitializeChat{}, r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
temp += n4
|
||||
}
|
||||
if bitset.Get(0x04) {
|
||||
n4, err := playerInfoRead(&infos, &PlayerInfoUpdateGameMode{}, r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
temp += n4
|
||||
}
|
||||
if bitset.Get(0x08) {
|
||||
n4, err := playerInfoRead(&infos, &PlayerInfoUpdateListed{}, r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
temp += n4
|
||||
}
|
||||
if bitset.Get(0x10) {
|
||||
n4, err := playerInfoRead(&infos, &PlayerInfoUpdateLatency{}, r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
temp += n4
|
||||
}
|
||||
if bitset.Get(0x20) {
|
||||
n4, err := playerInfoRead(&infos, &PlayerInfoUpdateDisplayName{}, r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
temp += n4
|
||||
}
|
||||
if bitset.Get(0x40) {
|
||||
n4, err := playerInfoRead(&infos, &PlayerInfoUpdateListPriority{}, r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
temp += n4
|
||||
}
|
||||
if bitset.Get(0x80) {
|
||||
n4, err := playerInfoRead(&infos, &PlayerInfoUpdateHat{}, r)
|
||||
if err != nil {
|
||||
return n1 + n2 + n3 + n4, err
|
||||
}
|
||||
temp += n4
|
||||
}
|
||||
|
||||
m[playerUUID] = infos
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func playerInfoRead(infos *[]PlayerInfo, info PlayerInfo, r io.Reader) (int64, error) {
|
||||
n, err := info.ReadFrom(r)
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
*infos = append(*infos, info)
|
||||
return n, err
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoAddPlayer struct {
|
||||
Name string
|
||||
Properties []user.Property
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoChatData struct {
|
||||
ChatSessionID uuid.UUID `mc:"UUID"`
|
||||
Session sign.Session
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoInitializeChat struct {
|
||||
Data pk.Option[PlayerInfoChatData, *PlayerInfoChatData]
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoUpdateGameMode struct {
|
||||
GameMode int32 `mc:"VarInt"`
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoUpdateListed struct {
|
||||
Listed bool
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoUpdateLatency struct {
|
||||
Ping int32 `mc:"VarInt"`
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoUpdateDisplayName struct {
|
||||
DisplayName pk.Option[chat.Message, *chat.Message]
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoUpdateListPriority struct {
|
||||
Priority int32 `mc:"VarInt"`
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerInfoUpdateHat struct {
|
||||
Visible bool
|
||||
}
|
||||
|
||||
func (PlayerInfoAddPlayer) playerInfoBitMask() int {
|
||||
return 0x01
|
||||
}
|
||||
|
||||
func (PlayerInfoInitializeChat) playerInfoBitMask() int {
|
||||
return 0x02
|
||||
}
|
||||
|
||||
func (PlayerInfoUpdateGameMode) playerInfoBitMask() int {
|
||||
return 0x04
|
||||
}
|
||||
|
||||
func (PlayerInfoUpdateListed) playerInfoBitMask() int {
|
||||
return 0x08
|
||||
}
|
||||
|
||||
func (PlayerInfoUpdateLatency) playerInfoBitMask() int {
|
||||
return 0x10
|
||||
}
|
||||
|
||||
func (PlayerInfoUpdateDisplayName) playerInfoBitMask() int {
|
||||
return 0x20
|
||||
}
|
||||
|
||||
func (PlayerInfoUpdateListPriority) playerInfoBitMask() int {
|
||||
return 0x40
|
||||
}
|
||||
|
||||
func (PlayerInfoUpdateHat) playerInfoBitMask() int {
|
||||
return 0x80
|
||||
}
|
16
codec/packet/game/client/player_look_at.go
Normal file
16
codec/packet/game/client/player_look_at.go
Normal file
@ -0,0 +1,16 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type LookedAtEntity struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
LookType int32 `mc:"VarInt"`
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type LookAt struct {
|
||||
LookType int32 `mc:"VarInt"` // Feet = 0 Eyes = 1
|
||||
TargetX, TargetY, TargetZ float64
|
||||
HasLookedAtEntity bool
|
||||
//opt:optional:HasLookedAtEntity
|
||||
LookedAtEntity *LookedAtEntity
|
||||
}
|
@ -6,17 +6,13 @@ import (
|
||||
|
||||
var _ ClientboundPacket = (*PlayerPosition)(nil)
|
||||
|
||||
//codec:gen
|
||||
type PositionMoveRotation struct {
|
||||
X, Y, Z float64
|
||||
YRot, XRot float32
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type PlayerPosition struct {
|
||||
ID int32 `mc:"VarInt"`
|
||||
Change PositionMoveRotation
|
||||
Relatives uint8
|
||||
ID int32 `mc:"VarInt"`
|
||||
X, Y, Z float64
|
||||
VelocityX, VelocityY, VelocityZ float64
|
||||
YRot, XRot float32
|
||||
Flags int32
|
||||
}
|
||||
|
||||
func (PlayerPosition) ClientboundPacketID() packetid.ClientboundPacketID {
|
||||
|
7
codec/packet/game/client/player_rotation.go
Normal file
7
codec/packet/game/client/player_rotation.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type PlayerRotation struct {
|
||||
Yaw float32
|
||||
Pitch float32
|
||||
}
|
7
codec/packet/game/client/projectile_power.go
Normal file
7
codec/packet/game/client/projectile_power.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type ProjectilePower struct {
|
||||
EntityID int32
|
||||
Power float64
|
||||
}
|
29
codec/packet/game/client/recipe_book_add.go
Normal file
29
codec/packet/game/client/recipe_book_add.go
Normal file
@ -0,0 +1,29 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/codec/slot/display/recipe"
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type RecipeIngredients struct {
|
||||
Data []pk.IDSet
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type Recipe struct {
|
||||
RecipeID int32 `mc:"VarInt"`
|
||||
Display recipe.Display
|
||||
GroupID int32 `mc:"VarInt"`
|
||||
CategoryID int32 `mc:"VarInt"`
|
||||
HasIngredients bool
|
||||
//opt:optional:HasIngredients
|
||||
Ingredients RecipeIngredients
|
||||
Flags int8
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type RecipeBookAdd struct {
|
||||
Recipes []Recipe
|
||||
Replace bool
|
||||
}
|
6
codec/packet/game/client/recipe_book_remove.go
Normal file
6
codec/packet/game/client/recipe_book_remove.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type RecipeBookRemove struct {
|
||||
Recipes []int32 `mc:"VarInt"`
|
||||
}
|
12
codec/packet/game/client/recipe_book_settings.go
Normal file
12
codec/packet/game/client/recipe_book_settings.go
Normal file
@ -0,0 +1,12 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type RecipeBookSettings struct {
|
||||
CraftingRecipeBookOpen bool
|
||||
CraftingRecipeBookFilterEnabled bool
|
||||
SmeltingRecipeBookOpen bool
|
||||
SmeltingRecipeBookFilterEnabled bool
|
||||
BlastingFurnaceRecipeBookOpen bool
|
||||
SmokingRecipeBookOpen bool
|
||||
SmokingRecipeBookFilterEnabled bool
|
||||
}
|
6
codec/packet/game/client/remove_entities.go
Normal file
6
codec/packet/game/client/remove_entities.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type RemoveEntities struct {
|
||||
EntityIDs []int32 `mc:"VarInt"`
|
||||
}
|
7
codec/packet/game/client/remove_mob_effect.go
Normal file
7
codec/packet/game/client/remove_mob_effect.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type RemoveMobEffect struct {
|
||||
EntityID int32
|
||||
EffectID int32
|
||||
}
|
1
codec/packet/game/client/reset_score.go
Normal file
1
codec/packet/game/client/reset_score.go
Normal file
@ -0,0 +1 @@
|
||||
package client
|
12
codec/packet/game/client/resource_pack_pop.go
Normal file
12
codec/packet/game/client/resource_pack_pop.go
Normal file
@ -0,0 +1,12 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type RemoveResourcePacket struct {
|
||||
HasUUID bool
|
||||
//opt:optional:HasUUID
|
||||
UUID uuid.UUID `mc:"UUID"`
|
||||
}
|
17
codec/packet/game/client/resource_pack_push.go
Normal file
17
codec/packet/game/client/resource_pack_push.go
Normal file
@ -0,0 +1,17 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/chat"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type AddResourcePack struct {
|
||||
UUID uuid.UUID `mc:"UUID"`
|
||||
URL string
|
||||
Hash string
|
||||
Forced bool
|
||||
HasPromptMessage bool
|
||||
//opt:optional:HasPromptMessage
|
||||
PromptMessage chat.Message
|
||||
}
|
9
codec/packet/game/client/rotate_head.go
Normal file
9
codec/packet/game/client/rotate_head.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import pk "github.com/Tnze/go-mc/net/packet"
|
||||
|
||||
//codec:gen
|
||||
type SetHeadRotation struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
HeadYaw pk.Angle
|
||||
}
|
35
codec/packet/game/client/sections_blocks_update.go
Normal file
35
codec/packet/game/client/sections_blocks_update.go
Normal file
@ -0,0 +1,35 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type UpdateSectionsBlocks struct {
|
||||
ChunkSectionPosition int64
|
||||
Blocks []int64 `mc:"VarLong"`
|
||||
}
|
||||
|
||||
func (s *UpdateSectionsBlocks) SetSectionPos(x, y, z int32) {
|
||||
s.ChunkSectionPosition = ((int64(x) & 0x3FFFFF) << 42) | (int64(y) & 0xFFFFF) | ((int64(z) & 0x3FFFFF) << 20)
|
||||
}
|
||||
|
||||
func (s UpdateSectionsBlocks) ToSectionPos() (x, y, z int32) {
|
||||
sectionX := int32(s.ChunkSectionPosition >> 42)
|
||||
sectionY := int32(s.ChunkSectionPosition << 44 >> 44)
|
||||
sectionZ := int32(s.ChunkSectionPosition >> 22 >> 42)
|
||||
return sectionX, sectionY, sectionZ
|
||||
}
|
||||
|
||||
func (s *UpdateSectionsBlocks) AddBlock(x, y, z int, stateID int32) {
|
||||
s.Blocks = append(s.Blocks, int64(stateID)<<12|(int64(x)<<8|int64(y)<<4|int64(z)))
|
||||
}
|
||||
|
||||
func (s UpdateSectionsBlocks) ParseBlocks() map[[3]int32]int32 {
|
||||
m := make(map[[3]int32]int32)
|
||||
for _, block := range s.Blocks {
|
||||
blockStateId := block >> 12
|
||||
blockLocalX := (block >> 8) & 0xF
|
||||
blockLocalY := block & 0xF
|
||||
blockLocalZ := (block >> 4) & 0xF
|
||||
|
||||
m[[3]int32{int32(blockLocalX), int32(blockLocalY), int32(blockLocalZ)}] = int32(blockStateId)
|
||||
}
|
||||
return m
|
||||
}
|
8
codec/packet/game/client/select_advancements_tab.go
Normal file
8
codec/packet/game/client/select_advancements_tab.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SelectAdvancementsTab struct {
|
||||
HasIdentifier bool
|
||||
//opt:optional:HasIdentifier
|
||||
Identifier string `mc:"Identifier"`
|
||||
}
|
13
codec/packet/game/client/server_data.go
Normal file
13
codec/packet/game/client/server_data.go
Normal file
@ -0,0 +1,13 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/chat"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type ServerData struct {
|
||||
MOTD chat.Message
|
||||
HasIcon bool
|
||||
//opt:optional:HasIcon
|
||||
Icon []int8 `mc:"Byte"`
|
||||
}
|
16
codec/packet/game/client/server_links.go
Normal file
16
codec/packet/game/client/server_links.go
Normal file
@ -0,0 +1,16 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
type ServerLinkData struct {
|
||||
IsBuiltin bool
|
||||
//opt:enum:IsBuiltin:true
|
||||
Type int32 `mc:"VarInt"`
|
||||
//opt:enum:IsBuiltin:false
|
||||
Name chat.Message
|
||||
URL string
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type ServerLinks struct {
|
||||
}
|
8
codec/packet/game/client/set_action_bar_text.go
Normal file
8
codec/packet/game/client/set_action_bar_text.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
//codec:gen
|
||||
type SetActionBarText struct {
|
||||
Text chat.Message
|
||||
}
|
6
codec/packet/game/client/set_border_center.go
Normal file
6
codec/packet/game/client/set_border_center.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetBorderCenter struct {
|
||||
X, Z float64
|
||||
}
|
6
codec/packet/game/client/set_border_lerp_size.go
Normal file
6
codec/packet/game/client/set_border_lerp_size.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
type SetBorderLerpSize struct {
|
||||
OldDiameter, NewDiameter float64
|
||||
Speed int64 `mc:"VarLong"`
|
||||
}
|
6
codec/packet/game/client/set_border_size.go
Normal file
6
codec/packet/game/client/set_border_size.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetBorderSize struct {
|
||||
Diameter float64
|
||||
}
|
6
codec/packet/game/client/set_border_warning_delay.go
Normal file
6
codec/packet/game/client/set_border_warning_delay.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetBorderWarningDelay struct {
|
||||
WarningTime int32 `mc:"VarInt"`
|
||||
}
|
6
codec/packet/game/client/set_border_warning_distance.go
Normal file
6
codec/packet/game/client/set_border_warning_distance.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetBorderWarningDistance struct {
|
||||
WarningBlocks int32 `mc:"VarInt"`
|
||||
}
|
6
codec/packet/game/client/set_camera.go
Normal file
6
codec/packet/game/client/set_camera.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetCamera struct {
|
||||
CameraID int32 `mc:"VarInt"`
|
||||
}
|
6
codec/packet/game/client/set_chunk_cache_center.go
Normal file
6
codec/packet/game/client/set_chunk_cache_center.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetCenterChunk struct {
|
||||
X, Z int32 `mc:"VarInt"`
|
||||
}
|
6
codec/packet/game/client/set_chunk_cache_radius.go
Normal file
6
codec/packet/game/client/set_chunk_cache_radius.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetRenderDistance struct {
|
||||
ViewDistance int32 `mc:"VarInt"`
|
||||
}
|
8
codec/packet/game/client/set_cursor_item.go
Normal file
8
codec/packet/game/client/set_cursor_item.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
import "git.konjactw.dev/patyhank/minego/codec/slot"
|
||||
|
||||
//codec:gen
|
||||
type SetCursorItem struct {
|
||||
CarriedItem slot.Slot
|
||||
}
|
9
codec/packet/game/client/set_default_spawn_position.go
Normal file
9
codec/packet/game/client/set_default_spawn_position.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import pk "github.com/Tnze/go-mc/net/packet"
|
||||
|
||||
//codec:gen
|
||||
type SetDefaultSpawnPosition struct {
|
||||
Location pk.Position
|
||||
Angle float32
|
||||
}
|
7
codec/packet/game/client/set_display_objective.go
Normal file
7
codec/packet/game/client/set_display_objective.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type DisplayObjective struct {
|
||||
Position int32 `mc:"VarInt"`
|
||||
ScoreName string
|
||||
}
|
11
codec/packet/game/client/set_entity_data.go
Normal file
11
codec/packet/game/client/set_entity_data.go
Normal file
@ -0,0 +1,11 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/codec/metadata"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type SetEntityMetadata struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
Metadata metadata.EntityMetadata
|
||||
}
|
7
codec/packet/game/client/set_entity_link.go
Normal file
7
codec/packet/game/client/set_entity_link.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetEntityLink struct {
|
||||
AttachedEntityID int32
|
||||
HoldingEntityID int32 // leader, -1 to detach
|
||||
}
|
6
codec/packet/game/client/set_entity_motion.go
Normal file
6
codec/packet/game/client/set_entity_motion.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
type SetEntityVelocity struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
VelocityX, VelocityY, VelocityZ int16
|
||||
}
|
67
codec/packet/game/client/set_equipment.go
Normal file
67
codec/packet/game/client/set_equipment.go
Normal file
@ -0,0 +1,67 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/codec/slot"
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
"io"
|
||||
)
|
||||
|
||||
type EquipmentData struct {
|
||||
Slot int8
|
||||
Item slot.Slot
|
||||
}
|
||||
|
||||
type Equipment []EquipmentData
|
||||
|
||||
func (e Equipment) WriteTo(w io.Writer) (n int64, err error) {
|
||||
for i, equipment := range e {
|
||||
b := equipment.Slot
|
||||
if len(e)-1 == i {
|
||||
b |= -128
|
||||
}
|
||||
|
||||
n1, err := pk.Byte(b).WriteTo(w)
|
||||
n += n1
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
n2, err := equipment.Item.WriteTo(w)
|
||||
n += n2
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (e *Equipment) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
for {
|
||||
var b pk.Byte
|
||||
n1, err := b.ReadFrom(r)
|
||||
n += n1
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
|
||||
var equipment EquipmentData
|
||||
equipment.Slot = int8(b & 127)
|
||||
n2, err := equipment.Item.ReadFrom(r)
|
||||
n += n2
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
|
||||
*e = append(*e, equipment)
|
||||
if n&-128 == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type SetEquipment struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
Equipment
|
||||
}
|
8
codec/packet/game/client/set_experience.go
Normal file
8
codec/packet/game/client/set_experience.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetExperience struct {
|
||||
ExperienceBar float32
|
||||
Level int32 `mc:"VarInt"`
|
||||
TotalExperience int32 `mc:"VarInt"`
|
||||
}
|
10
codec/packet/game/client/set_health.go
Normal file
10
codec/packet/game/client/set_health.go
Normal file
@ -0,0 +1,10 @@
|
||||
package client
|
||||
|
||||
import "git.konjactw.dev/patyhank/minego/codec/metadata"
|
||||
|
||||
//codec:gen
|
||||
type SetHealth struct {
|
||||
Health float32
|
||||
Food metadata.VarInt
|
||||
FoodSaturation float32
|
||||
}
|
6
codec/packet/game/client/set_held_slot.go
Normal file
6
codec/packet/game/client/set_held_slot.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetHeldItem struct {
|
||||
Slot int32 `mc:"VarInt"`
|
||||
}
|
29
codec/packet/game/client/set_objective.go
Normal file
29
codec/packet/game/client/set_objective.go
Normal file
@ -0,0 +1,29 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
//codec:gen
|
||||
type ObjectivesData struct {
|
||||
Value chat.Message
|
||||
HasNumberFormat bool
|
||||
//opt:optional:HasNumberFormat
|
||||
NumberFormat *ScoreNumberFormat
|
||||
}
|
||||
|
||||
type ObjectivesCreateData struct {
|
||||
ObjectivesData
|
||||
}
|
||||
|
||||
type ObjectivesUpdateData struct {
|
||||
ObjectivesData
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateObjectives struct {
|
||||
ObjectiveName string
|
||||
Mode int8
|
||||
//opt:enum:Mode:0
|
||||
Create ObjectivesCreateData
|
||||
//opt:enum:Mode:2
|
||||
Update ObjectivesUpdateData
|
||||
}
|
7
codec/packet/game/client/set_passengers.go
Normal file
7
codec/packet/game/client/set_passengers.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetPassengers struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
Passengers []int32 `mc:"VarInt"`
|
||||
}
|
9
codec/packet/game/client/set_player_inventory.go
Normal file
9
codec/packet/game/client/set_player_inventory.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import "git.konjactw.dev/patyhank/minego/codec/slot"
|
||||
|
||||
//codec:gen
|
||||
type SetPlayerInventory struct {
|
||||
Slot int32 `mc:"VarInt"`
|
||||
Data slot.Slot
|
||||
}
|
58
codec/packet/game/client/set_player_team.go
Normal file
58
codec/packet/game/client/set_player_team.go
Normal file
@ -0,0 +1,58 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/chat"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type UpdateTeams struct {
|
||||
TeamName string
|
||||
Type int8
|
||||
//opt:enum:Type:0
|
||||
CreateTeam UpdateTeamsCreateTeam
|
||||
//opt:enum:Type:1
|
||||
RemoveTeam UpdateTeamsRemoveTeam
|
||||
//opt:enum:Type:2
|
||||
UpdateTeam UpdateTeamsUpdateTeam
|
||||
//opt:enum:Type:3
|
||||
AddEntities UpdateTeamsAddEntities
|
||||
//opt:enum:Type:4
|
||||
RemoveEntities UpdateTeamsRemoveEntities
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateTeamsCreateTeam struct {
|
||||
TeamDisplayName chat.Message
|
||||
FriendlyFlags int8
|
||||
NameTagVisibility int32 `mc:"VarInt"`
|
||||
CollisionRule int32 `mc:"VarInt"`
|
||||
TeamColor int32 `mc:"VarInt"`
|
||||
TeamPrefix chat.Message
|
||||
TeamSuffix chat.Message
|
||||
Entities []string `mc:"String"`
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateTeamsRemoveTeam struct {
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateTeamsUpdateTeam struct {
|
||||
DisplayName chat.Message
|
||||
FriendlyFlags int8
|
||||
NameTagVisibility int32 `mc:"VarInt"`
|
||||
CollisionRule int32 `mc:"VarInt"`
|
||||
TeamColor int32 `mc:"VarInt"`
|
||||
TeamPrefix chat.Message
|
||||
TeamSuffix chat.Message
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateTeamsAddEntities struct {
|
||||
Entities []string `mc:"String"`
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateTeamsRemoveEntities struct {
|
||||
Entities []string `mc:"String"`
|
||||
}
|
28
codec/packet/game/client/set_score.go
Normal file
28
codec/packet/game/client/set_score.go
Normal file
@ -0,0 +1,28 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/chat"
|
||||
"github.com/Tnze/go-mc/nbt"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type ScoreNumberFormat struct {
|
||||
NumberFormat int32
|
||||
//opt:enum:NumberFormat:1
|
||||
StyledTag nbt.RawMessage `mc:"NBT"`
|
||||
//opt:enum:NumberFormat:2
|
||||
Content chat.Message
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateScore struct {
|
||||
EntityName string
|
||||
ObjectiveName string
|
||||
Value int32 `mc:"VarInt"`
|
||||
HasDisplayName bool
|
||||
//opt:optional:HasDisplayName
|
||||
DisplayName chat.Message
|
||||
HasScoreFormat bool
|
||||
//opt:optional:HasScoreFormat
|
||||
NumberFormat ScoreNumberFormat
|
||||
}
|
6
codec/packet/game/client/set_simulation_distance.go
Normal file
6
codec/packet/game/client/set_simulation_distance.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetSimulationDistance struct {
|
||||
Distance int32 `mc:"VarInt"`
|
||||
}
|
8
codec/packet/game/client/set_subtitle_text.go
Normal file
8
codec/packet/game/client/set_subtitle_text.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
//codec:gen
|
||||
type SetSubtitleText struct {
|
||||
SubtitleText chat.Message
|
||||
}
|
8
codec/packet/game/client/set_time.go
Normal file
8
codec/packet/game/client/set_time.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetTime struct {
|
||||
WorldAge int64
|
||||
TimeOfDay int64
|
||||
TimeOfDayIncreasing bool
|
||||
}
|
8
codec/packet/game/client/set_title_text.go
Normal file
8
codec/packet/game/client/set_title_text.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
//codec:gen
|
||||
type SetTitleText struct {
|
||||
Text chat.Message
|
||||
}
|
8
codec/packet/game/client/set_titles_animation.go
Normal file
8
codec/packet/game/client/set_titles_animation.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetTitleAnimationTimes struct {
|
||||
FadeIn int32
|
||||
Stay int32
|
||||
FadeOut int32
|
||||
}
|
11
codec/packet/game/client/show_dialog.go
Normal file
11
codec/packet/game/client/show_dialog.go
Normal file
@ -0,0 +1,11 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/Tnze/go-mc/nbt"
|
||||
)
|
||||
|
||||
type ShowDialog struct {
|
||||
DialogID int32 `mc:"VarInt"`
|
||||
//opt:id:DialogID
|
||||
DialogData nbt.RawMessage `mc:"NBT"`
|
||||
}
|
13
codec/packet/game/client/sound.go
Normal file
13
codec/packet/game/client/sound.go
Normal file
@ -0,0 +1,13 @@
|
||||
package client
|
||||
|
||||
import "git.konjactw.dev/patyhank/minego/codec/component"
|
||||
|
||||
//codec:gen
|
||||
type SoundEffect struct {
|
||||
SoundID int32 `mc:"VarInt"`
|
||||
//opt:id:SoundID
|
||||
SoundEvent *component.SoundEvent
|
||||
EffectPositionX, EffectPositionY, EffectPositionZ int32
|
||||
Volume, Pitch float32
|
||||
Seed int64
|
||||
}
|
16
codec/packet/game/client/sound_entity.go
Normal file
16
codec/packet/game/client/sound_entity.go
Normal file
@ -0,0 +1,16 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/codec/component"
|
||||
"github.com/Tnze/go-mc/net/packet"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type EntitySoundEffect struct {
|
||||
SoundEvent packet.OptID[component.SoundEvent, *component.SoundEvent]
|
||||
SoundCategory int32 `mc:"VarInt"`
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
Volume float32
|
||||
Pitch float32
|
||||
Seed int32
|
||||
}
|
5
codec/packet/game/client/start_configuration.go
Normal file
5
codec/packet/game/client/start_configuration.go
Normal file
@ -0,0 +1,5 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type StartConfiguration struct {
|
||||
}
|
34
codec/packet/game/client/stop_sound.go
Normal file
34
codec/packet/game/client/stop_sound.go
Normal file
@ -0,0 +1,34 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
"io"
|
||||
)
|
||||
|
||||
type StopSound struct {
|
||||
Flags int8
|
||||
Source int32 `mc:"VarInt"`
|
||||
Sound string `mc:"Identifier"`
|
||||
}
|
||||
|
||||
func (s StopSound) WriteTo(w io.Writer) (n int64, err error) {
|
||||
pk.Byte(s.Flags).WriteTo(w)
|
||||
if s.Flags&0x01 != 0 {
|
||||
pk.VarInt(s.Source).WriteTo(w)
|
||||
}
|
||||
if s.Flags&0x02 != 0 {
|
||||
pk.Identifier(s.Sound).WriteTo(w)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *StopSound) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
(*pk.Byte)(&s.Flags).ReadFrom(r)
|
||||
if s.Flags&0x01 != 0 {
|
||||
(*pk.VarInt)(&s.Source).ReadFrom(r)
|
||||
}
|
||||
if s.Flags&0x02 != 0 {
|
||||
(*pk.Identifier)(&s.Sound).ReadFrom(r)
|
||||
}
|
||||
return
|
||||
}
|
7
codec/packet/game/client/store_cookie.go
Normal file
7
codec/packet/game/client/store_cookie.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type StoreCookie struct {
|
||||
Key string `mc:"Identifier"`
|
||||
Payload []int8 `mc:"Byte"`
|
||||
}
|
9
codec/packet/game/client/system_chat.go
Normal file
9
codec/packet/game/client/system_chat.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
//codec:gen
|
||||
type SystemChatMessage struct {
|
||||
Content chat.Message
|
||||
Overlay bool
|
||||
}
|
8
codec/packet/game/client/tab_list.go
Normal file
8
codec/packet/game/client/tab_list.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
type SetTabListHeaderAndFooter struct {
|
||||
Header chat.Message
|
||||
Footer chat.Message
|
||||
}
|
9
codec/packet/game/client/tag_query.go
Normal file
9
codec/packet/game/client/tag_query.go
Normal file
@ -0,0 +1,9 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/nbt"
|
||||
|
||||
//codec:gen
|
||||
type TagQueryResponse struct {
|
||||
TransactionID int32 `mc:"VarInt"`
|
||||
NBT nbt.RawMessage `mc:"NBT"`
|
||||
}
|
8
codec/packet/game/client/take_item_entity.go
Normal file
8
codec/packet/game/client/take_item_entity.go
Normal file
@ -0,0 +1,8 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type PickupItem struct {
|
||||
CollectedEntityID int32 `mc:"VarInt"`
|
||||
CollectorEntityID int32 `mc:"VarInt"`
|
||||
PickupItemCount int32 `mc:"VarInt"`
|
||||
}
|
10
codec/packet/game/client/teleport_entity.go
Normal file
10
codec/packet/game/client/teleport_entity.go
Normal file
@ -0,0 +1,10 @@
|
||||
package client
|
||||
|
||||
type SynchronizeVehiclePosition struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
X, Y, Z float64
|
||||
VelocityX, VelocityY, VelocityZ float64
|
||||
Yaw, Pitch float32
|
||||
Flags int32
|
||||
OnGround bool
|
||||
}
|
15
codec/packet/game/client/test_instance_block_status.go
Normal file
15
codec/packet/game/client/test_instance_block_status.go
Normal file
@ -0,0 +1,15 @@
|
||||
package client
|
||||
|
||||
import "github.com/Tnze/go-mc/chat"
|
||||
|
||||
//codec:gen
|
||||
type TestInstanceBlockStatus struct {
|
||||
Status chat.Message
|
||||
HasSize bool
|
||||
//opt:optional:HasSize
|
||||
SizeX float64
|
||||
//opt:optional:HasSize
|
||||
SizeY float64
|
||||
//opt:optional:HasSize
|
||||
SizeZ float64
|
||||
}
|
7
codec/packet/game/client/ticking_state.go
Normal file
7
codec/packet/game/client/ticking_state.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type SetTickingState struct {
|
||||
TickRate float32
|
||||
IsFrozen bool
|
||||
}
|
6
codec/packet/game/client/ticking_step.go
Normal file
6
codec/packet/game/client/ticking_step.go
Normal file
@ -0,0 +1,6 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type StepTick struct {
|
||||
TickSteps int32 `mc:"VarInt"`
|
||||
}
|
7
codec/packet/game/client/transfer.go
Normal file
7
codec/packet/game/client/transfer.go
Normal file
@ -0,0 +1,7 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type Transfer struct {
|
||||
Host string
|
||||
Port int32 `mc:"VarInt"`
|
||||
}
|
54
codec/packet/game/client/update_advancements.go
Normal file
54
codec/packet/game/client/update_advancements.go
Normal file
@ -0,0 +1,54 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/codec/slot"
|
||||
"github.com/Tnze/go-mc/chat"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type AdvancementDisplay struct {
|
||||
Title chat.Message
|
||||
Description chat.Message
|
||||
Icon slot.Slot
|
||||
FrameType int32 `mc:"VarInt"`
|
||||
Flags int32
|
||||
HasBackgroundTexture bool
|
||||
//opt:optional:HasBackgroundTexture
|
||||
BackgroundTexture string `mc:"Identifier"`
|
||||
X, Y float32
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type AdvancementRequirements struct {
|
||||
OR []string
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type Advancement struct {
|
||||
ID string `mc:"Identifier"`
|
||||
HasParentID bool
|
||||
//opt:optional:HasParentID
|
||||
ParentID string
|
||||
HasDisplayData bool
|
||||
//opt:optional:HasDisplayData
|
||||
DisplayData AdvancementDisplay
|
||||
Requirements []AdvancementRequirements
|
||||
SendTelemetryData bool
|
||||
}
|
||||
|
||||
type AdvancementProgress struct {
|
||||
ID string `mc:"Identifier"`
|
||||
CriterionId string `mc:"Identifier"`
|
||||
HasAchieved bool
|
||||
//opt:optional:HasAchieved
|
||||
AchievingDate int64
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateAdvancements struct {
|
||||
Clear bool
|
||||
Advancements []Advancement
|
||||
RemovedIds []string `mc:"Identifier"`
|
||||
Progress []AdvancementProgress
|
||||
ShowAdvancementsToast bool
|
||||
}
|
21
codec/packet/game/client/update_attributes.go
Normal file
21
codec/packet/game/client/update_attributes.go
Normal file
@ -0,0 +1,21 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type AttributeModifier struct {
|
||||
Id string `mc:"Identifier"`
|
||||
Amount float64
|
||||
Operation int8
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type Attribute struct {
|
||||
Id int32 `mc:"VarInt"`
|
||||
Value float64
|
||||
Modifiers []AttributeModifier
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateAttributes struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
Attributes []Attribute
|
||||
}
|
10
codec/packet/game/client/update_mob_effect.go
Normal file
10
codec/packet/game/client/update_mob_effect.go
Normal file
@ -0,0 +1,10 @@
|
||||
package client
|
||||
|
||||
//codec:gen
|
||||
type EntityEffect struct {
|
||||
EntityID int32 `mc:"VarInt"`
|
||||
EffectID int32 `mc:"VarInt"`
|
||||
Amplifier int32 `mc:"VarInt"`
|
||||
Duration int32 `mc:"VarInt"`
|
||||
Flags int8
|
||||
}
|
24
codec/packet/game/client/update_recipes.go
Normal file
24
codec/packet/game/client/update_recipes.go
Normal file
@ -0,0 +1,24 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"git.konjactw.dev/patyhank/minego/codec/slot/display/slot"
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
)
|
||||
|
||||
//codec:gen
|
||||
type PropertySet struct {
|
||||
Id string `mc:"Identifier"`
|
||||
Items []int32 `mc:"VarInt"`
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type StonecutterRecipe struct {
|
||||
Ingredient pk.IDSet
|
||||
SlotDisplay slot.Display
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type UpdateRecipes struct {
|
||||
PropertySets []PropertySet
|
||||
StonecutterRecipes []StonecutterRecipe
|
||||
}
|
15
codec/packet/game/client/update_tags.go
Normal file
15
codec/packet/game/client/update_tags.go
Normal file
@ -0,0 +1,15 @@
|
||||
package client
|
||||
|
||||
type Tag struct {
|
||||
Name string `mc:"Identifier"`
|
||||
Entries []int32 `mc:"VarInt"`
|
||||
}
|
||||
|
||||
type RegistryTag struct {
|
||||
Registry string `mc:"Identifier"`
|
||||
Tags []Tag
|
||||
}
|
||||
|
||||
type UpdateTags struct {
|
||||
Data []RegistryTag
|
||||
}
|
40
codec/packet/game/client/waypoint.go
Normal file
40
codec/packet/game/client/waypoint.go
Normal file
@ -0,0 +1,40 @@
|
||||
package client
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
//codec:gen
|
||||
type WaypointColor struct {
|
||||
R, G, B uint8
|
||||
}
|
||||
|
||||
//codec:gen
|
||||
type WaypointVec3i struct {
|
||||
X, Y, Z int32 `mc:"VarInt"`
|
||||
}
|
||||
|
||||
type WaypointChunkPos struct {
|
||||
X, Z int32 `mc:"VarInt"`
|
||||
}
|
||||
|
||||
type WaypointAzimuth struct {
|
||||
Angle float32
|
||||
}
|
||||
|
||||
type Waypoint struct {
|
||||
Operation int32 `mc:"VarInt"`
|
||||
IsUUIDIdentifier bool
|
||||
//opt:enum:IsUUIDIdentifier:true
|
||||
UUID uuid.UUID `mc:"UUID"`
|
||||
//opt:enum:IsUUIDIdentifier:false
|
||||
Name string
|
||||
HasColor bool
|
||||
//opt:optional:HasColor
|
||||
Color WaypointColor
|
||||
WaypointType int32 `mc:"VarInt"`
|
||||
//opt:enum:WaypointType:1
|
||||
WaypointPlayerPos WaypointVec3i
|
||||
//opt:enum:WaypointType:2
|
||||
WaypointChunkPos WaypointChunkPos
|
||||
//opt:enum:WaypointType:3
|
||||
WaypointAzimuth WaypointAzimuth
|
||||
}
|
Reference in New Issue
Block a user