Skip to content

Commit 9055a61

Browse files
committed
fix: respawn packet data
1 parent 2c0e981 commit 9055a61

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pumpkin-protocol/src/java/client/play/respawn.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ pub struct CRespawn {
1515
}
1616

1717
impl CRespawn {
18+
pub const KEEP_ATTRIBUTE_MODIFIERS: u8 = 1;
19+
pub const KEEP_ENTITY_DATA: u8 = 2;
20+
pub const KEEP_ALL_DATA: u8 = 3;
21+
1822
#[must_use]
1923
pub const fn new(player_spawn_info: PlayerSpawnData, data_kept: u8) -> Self {
2024
Self {

pumpkin/src/entity/player.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,14 +2510,14 @@ impl Player {
25102510
new_world.dimension.clone(),
25112511
biome::hash_seed(new_world.level.seed.0), // seed
25122512
self.gamemode.load() as u8,
2513-
self.gamemode.load() as i8,
2513+
self.previous_gamemode.load().unwrap_or(self.gamemode.load()) as i8,
25142514
false,
25152515
false,
25162516
Some((death_dimension, death_location)),
25172517
VarInt(self.get_entity().portal_cooldown.load(Ordering::Relaxed) as i32),
25182518
new_world.sea_level.into(),
25192519
),
2520-
1,
2520+
CRespawn::KEEP_ALL_DATA,
25212521
)).await;
25222522

25232523
self.send_permission_lvl_update();

0 commit comments

Comments
 (0)