Merge pull request #167 from patyhank/master
This commit is contained in:
@ -21,6 +21,7 @@ func NewPlayer(c *bot.Client, settings Settings) *Player {
|
||||
bot.PacketHandler{Priority: 0, ID: packetid.ClientboundLogin, F: b.handleLoginPacket},
|
||||
bot.PacketHandler{Priority: 0, ID: packetid.ClientboundKeepAlive, F: b.handleKeepAlivePacket},
|
||||
bot.PacketHandler{Priority: 0, ID: packetid.ClientboundPlayerPosition, F: b.handlePlayerPosition},
|
||||
bot.PacketHandler{Priority: 0, ID: packetid.ClientboundRespawn, F: b.handleRespawnPacket},
|
||||
)
|
||||
return b
|
||||
}
|
||||
|
@ -111,3 +111,20 @@ func (p *Player) handleLoginPacket(packet pk.Packet) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (p *Player) handleRespawnPacket(packet pk.Packet) error {
|
||||
var copyMeta bool
|
||||
err := packet.Scan(
|
||||
pk.NBT(&p.WorldInfo.Dimension),
|
||||
(*pk.Identifier)(&p.WorldName),
|
||||
(*pk.Long)(&p.HashedSeed),
|
||||
(*pk.UnsignedByte)(&p.Gamemode),
|
||||
(*pk.Byte)(&p.PrevGamemode),
|
||||
(*pk.Boolean)(&p.IsDebug),
|
||||
(*pk.Boolean)(&p.IsFlat),
|
||||
(*pk.Boolean)(©Meta),
|
||||
)
|
||||
if err != nil {
|
||||
return Error{err}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user