/
client_respawn.go
45 lines (41 loc) · 1.41 KB
/
client_respawn.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package minecraft
import (
"github.com/LilyPad/GoLilyPad/packet/minecraft/nbt"
)
type PacketClientRespawn struct {
IdMapPacket
Dimension int32 // removed in 1.16+
DimensionName string // 1.16+ // removed in 1.16.2+ // added back in 1.19+
DimensionNBT nbt.Nbt // 1.16.2+ // removed in 1.19+
WorldName string // 1.16+
HashedSeed int64
Difficulty int8
Gamemode int8
PreviousGamemode int8 // 1.16+
LevelType string // removed in 1.16+
IsDebug bool // 1.16+
IsFlat bool // 1.16+
DeathLocation *Location // 1.19+
CopyMetadata bool // 1.16+
}
func NewPacketClientRespawnFrom(idMap *IdMap, joinGame *PacketClientJoinGame) (this *PacketClientRespawn) {
this = new(PacketClientRespawn)
this.IdFrom(idMap)
this.Dimension = int32(joinGame.Dimension)
this.DimensionName = joinGame.DimensionName
this.DimensionNBT = joinGame.DimensionNBT
this.WorldName = joinGame.WorldName
this.HashedSeed = joinGame.HashedSeed
this.Difficulty = joinGame.Difficulty
this.Gamemode = joinGame.Gamemode
this.PreviousGamemode = joinGame.PreviousGamemode
this.LevelType = joinGame.LevelType
this.IsDebug = joinGame.IsDebug
this.IsFlat = joinGame.IsFlat
this.DeathLocation = joinGame.DeathLocation
this.CopyMetadata = false
return
}
func (this *PacketClientRespawn) IdFrom(idMap *IdMap) {
this.IdMapPacket.id = idMap.PacketClientRespawn
}