Fix SpawnPainting parsing 1.13.2-1.14.4, closes #212 (#213)

The packet changed in 1.13.2 but wasn't updated, so we split the packet
variants into SpawnPainting_String for the old version and
SpawnPainting_VarInt for the new version with a 'motive' VarInt field
instead of a String title.

1.9-1.12.2 SpawnPainting_String: https://wiki.vg/index.php?title=Protocol&oldid=14204#Spawn_Painting
1.13.2-1.14.4 SpawnPainting_VarInt: https://wiki.vg/index.php?title=Protocol&oldid=14889#Spawn_Painting
This commit is contained in:
iceiix 2019-08-17 13:36:07 -07:00 committed by GitHub
parent 40c7a64c45
commit 57da39bb79
14 changed files with 21 additions and 14 deletions

View File

@ -619,7 +619,14 @@ state_packets!(
}
/// SpawnPainting spawns a painting into the world when it is in range of
/// the client. The title effects the size and the texture of the painting.
packet SpawnPainting {
packet SpawnPainting_VarInt {
field entity_id: VarInt =,
field uuid: UUID =,
field motive: VarInt =,
field location: Position =,
field direction: u8 =,
}
packet SpawnPainting_String {
field entity_id: VarInt =,
field uuid: UUID =,
field title: String =,

View File

@ -57,7 +57,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_String
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -57,7 +57,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_String
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -44,7 +44,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob_u8
0x04 => SpawnPainting
0x04 => SpawnPainting_String
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -44,7 +44,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_String
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -47,7 +47,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_VarInt
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -57,7 +57,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_VarInt
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -60,7 +60,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_VarInt
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -60,7 +60,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_VarInt
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -60,7 +60,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_VarInt
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -60,7 +60,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_VarInt
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -60,7 +60,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob
0x04 => SpawnPainting
0x04 => SpawnPainting_VarInt
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -44,7 +44,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob_u8
0x04 => SpawnPainting
0x04 => SpawnPainting_String
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics

View File

@ -44,7 +44,7 @@ protocol_packet_ids!(
0x01 => SpawnExperienceOrb
0x02 => SpawnGlobalEntity
0x03 => SpawnMob_u8
0x04 => SpawnPainting
0x04 => SpawnPainting_String
0x05 => SpawnPlayer_f64
0x06 => Animation
0x07 => Statistics