Handle Respawn_WorldName, split Respawn_Gamemode
This commit is contained in:
parent
b1fef97291
commit
ae3bdaed16
|
@ -1485,7 +1485,7 @@ state_packets!(
|
|||
field hash: String =,
|
||||
}
|
||||
/// Respawn is sent to respawn the player after death or when they move worlds.
|
||||
packet Respawn {
|
||||
packet Respawn_Gamemode {
|
||||
field dimension: i32 =,
|
||||
field difficulty: u8 =,
|
||||
field gamemode: u8 =,
|
||||
|
|
|
@ -88,7 +88,7 @@ protocol_packet_ids!(
|
|||
0x30 => EntityDestroy
|
||||
0x31 => EntityRemoveEffect
|
||||
0x32 => ResourcePackSend
|
||||
0x33 => Respawn
|
||||
0x33 => Respawn_Gamemode
|
||||
0x34 => EntityHeadLook
|
||||
0x35 => WorldBorder
|
||||
0x36 => Camera
|
||||
|
|
|
@ -110,7 +110,7 @@ protocol_packet_ids!(
|
|||
0x36 => EntityDestroy
|
||||
0x37 => EntityRemoveEffect
|
||||
0x38 => ResourcePackSend
|
||||
0x39 => Respawn
|
||||
0x39 => Respawn_Gamemode
|
||||
0x3a => EntityHeadLook
|
||||
0x3b => SelectAdvancementTab
|
||||
0x3c => WorldBorder
|
||||
|
|
|
@ -110,7 +110,7 @@ protocol_packet_ids!(
|
|||
0x36 => EntityDestroy
|
||||
0x37 => EntityRemoveEffect
|
||||
0x38 => ResourcePackSend
|
||||
0x39 => Respawn
|
||||
0x39 => Respawn_Gamemode
|
||||
0x3a => EntityHeadLook
|
||||
0x3b => SelectAdvancementTab
|
||||
0x3c => WorldBorder
|
||||
|
|
|
@ -91,7 +91,7 @@ protocol_packet_ids!(
|
|||
0x30 => EntityDestroy
|
||||
0x31 => EntityRemoveEffect
|
||||
0x32 => ResourcePackSend
|
||||
0x33 => Respawn
|
||||
0x33 => Respawn_Gamemode
|
||||
0x34 => EntityHeadLook
|
||||
0x35 => WorldBorder
|
||||
0x36 => Camera
|
||||
|
|
|
@ -91,7 +91,7 @@ protocol_packet_ids!(
|
|||
0x30 => EntityDestroy
|
||||
0x31 => EntityRemoveEffect
|
||||
0x32 => ResourcePackSend
|
||||
0x33 => Respawn
|
||||
0x33 => Respawn_Gamemode
|
||||
0x34 => EntityHeadLook
|
||||
0x35 => WorldBorder
|
||||
0x36 => Camera
|
||||
|
|
|
@ -96,7 +96,7 @@ protocol_packet_ids!(
|
|||
0x32 => EntityDestroy
|
||||
0x33 => EntityRemoveEffect
|
||||
0x34 => ResourcePackSend
|
||||
0x35 => Respawn
|
||||
0x35 => Respawn_Gamemode
|
||||
0x36 => EntityHeadLook
|
||||
0x37 => SelectAdvancementTab
|
||||
0x38 => WorldBorder
|
||||
|
|
|
@ -109,7 +109,7 @@ protocol_packet_ids!(
|
|||
0x35 => EntityDestroy
|
||||
0x36 => EntityRemoveEffect
|
||||
0x37 => ResourcePackSend
|
||||
0x38 => Respawn
|
||||
0x38 => Respawn_Gamemode
|
||||
0x39 => EntityHeadLook
|
||||
0x3a => SelectAdvancementTab
|
||||
0x3b => WorldBorder
|
||||
|
|
|
@ -114,7 +114,7 @@ protocol_packet_ids!(
|
|||
0x37 => EntityDestroy
|
||||
0x38 => EntityRemoveEffect
|
||||
0x39 => ResourcePackSend
|
||||
0x3a => Respawn
|
||||
0x3a => Respawn_Gamemode
|
||||
0x3b => EntityHeadLook
|
||||
0x3c => SelectAdvancementTab
|
||||
0x3d => WorldBorder
|
||||
|
|
|
@ -114,7 +114,7 @@ protocol_packet_ids!(
|
|||
0x37 => EntityDestroy
|
||||
0x38 => EntityRemoveEffect
|
||||
0x39 => ResourcePackSend
|
||||
0x3a => Respawn
|
||||
0x3a => Respawn_Gamemode
|
||||
0x3b => EntityHeadLook
|
||||
0x3c => SelectAdvancementTab
|
||||
0x3d => WorldBorder
|
||||
|
|
|
@ -114,7 +114,7 @@ protocol_packet_ids!(
|
|||
0x37 => EntityDestroy
|
||||
0x38 => EntityRemoveEffect
|
||||
0x39 => ResourcePackSend
|
||||
0x3a => Respawn
|
||||
0x3a => Respawn_Gamemode
|
||||
0x3b => EntityHeadLook
|
||||
0x3c => SelectAdvancementTab
|
||||
0x3d => WorldBorder
|
||||
|
|
|
@ -114,7 +114,7 @@ protocol_packet_ids!(
|
|||
0x37 => EntityDestroy
|
||||
0x38 => EntityRemoveEffect
|
||||
0x39 => ResourcePackSend
|
||||
0x3a => Respawn
|
||||
0x3a => Respawn_Gamemode
|
||||
0x3b => EntityHeadLook
|
||||
0x3c => SelectAdvancementTab
|
||||
0x3d => WorldBorder
|
||||
|
|
|
@ -114,7 +114,7 @@ protocol_packet_ids!(
|
|||
0x37 => EntityDestroy
|
||||
0x38 => EntityRemoveEffect
|
||||
0x39 => ResourcePackSend
|
||||
0x3a => Respawn
|
||||
0x3a => Respawn_Gamemode
|
||||
0x3b => EntityHeadLook
|
||||
0x3c => SelectAdvancementTab
|
||||
0x3d => WorldBorder
|
||||
|
|
|
@ -41,7 +41,7 @@ protocol_packet_ids!(
|
|||
0x04 => EntityEquipment_u16_i32
|
||||
0x05 => SpawnPosition_i32
|
||||
0x06 => UpdateHealth_u16
|
||||
0x07 => Respawn
|
||||
0x07 => Respawn_Gamemode
|
||||
0x08 => TeleportPlayer_OnGround
|
||||
0x09 => SetCurrentHotbarSlot
|
||||
0x0a => EntityUsedBed_i32
|
||||
|
|
|
@ -43,7 +43,7 @@ protocol_packet_ids!(
|
|||
0x04 => EntityEquipment_u16
|
||||
0x05 => SpawnPosition
|
||||
0x06 => UpdateHealth
|
||||
0x07 => Respawn
|
||||
0x07 => Respawn_Gamemode
|
||||
0x08 => TeleportPlayer_NoConfirm
|
||||
0x09 => SetCurrentHotbarSlot
|
||||
0x0a => EntityUsedBed
|
||||
|
|
|
@ -91,7 +91,7 @@ protocol_packet_ids!(
|
|||
0x30 => EntityDestroy
|
||||
0x31 => EntityRemoveEffect
|
||||
0x32 => ResourcePackSend
|
||||
0x33 => Respawn
|
||||
0x33 => Respawn_Gamemode
|
||||
0x34 => EntityHeadLook
|
||||
0x35 => WorldBorder
|
||||
0x36 => Camera
|
||||
|
|
|
@ -91,7 +91,7 @@ protocol_packet_ids!(
|
|||
0x30 => EntityDestroy
|
||||
0x31 => EntityRemoveEffect
|
||||
0x32 => ResourcePackSend
|
||||
0x33 => Respawn
|
||||
0x33 => Respawn_Gamemode
|
||||
0x34 => EntityHeadLook
|
||||
0x35 => WorldBorder
|
||||
0x36 => Camera
|
||||
|
|
|
@ -487,8 +487,9 @@ impl Server {
|
|||
JoinGame_i32 => on_game_join_i32,
|
||||
JoinGame_i8 => on_game_join_i8,
|
||||
JoinGame_i8_NoDebug => on_game_join_i8_nodebug,
|
||||
Respawn => on_respawn,
|
||||
Respawn_Gamemode => on_respawn_gamemode,
|
||||
Respawn_HashedSeed => on_respawn_hashedseed,
|
||||
Respawn_WorldName => on_respawn_worldname,
|
||||
KeepAliveClientbound_i64 => on_keep_alive_i64,
|
||||
KeepAliveClientbound_VarInt => on_keep_alive_varint,
|
||||
KeepAliveClientbound_i32 => on_keep_alive_i32,
|
||||
|
@ -1007,7 +1008,11 @@ impl Server {
|
|||
self.respawn(respawn.gamemode)
|
||||
}
|
||||
|
||||
fn on_respawn(&mut self, respawn: packet::play::clientbound::Respawn) {
|
||||
fn on_respawn_gamemode(&mut self, respawn: packet::play::clientbound::Respawn_Gamemode) {
|
||||
self.respawn(respawn.gamemode)
|
||||
}
|
||||
|
||||
fn on_respawn_worldname(&mut self, respawn: packet::play::clientbound::Respawn_WorldName) {
|
||||
self.respawn(respawn.gamemode)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue