diff --git a/data/latest/proto.yml b/data/latest/proto.yml index e9ad376..1513e1f 100644 --- a/data/latest/proto.yml +++ b/data/latest/proto.yml @@ -923,7 +923,15 @@ packet_set_spawn_position: packet_animate: !id: 0x2c !bound: both - action_id: zigzag32 + action_id: zigzag32 => + 0: none + 1: swing_arm + 2: unknown + 3: wake_up + 4: critical_hit + 5: magic_critical_hit + 6: row_right + 7: row_left runtime_entity_id: varint64 packet_respawn: diff --git a/src/relay.js b/src/relay.js index 26a44e2..d7aa98c 100644 --- a/src/relay.js +++ b/src/relay.js @@ -31,6 +31,7 @@ class RelayPlayer extends Player { this.outLog = this.downOutLog this.inLog = this.downInLog this.chunkSendCache = [] + this.respawnPacket = [] } // Called when we get a packet from backend server (Backend -> PROXY -> Client) @@ -54,14 +55,21 @@ class RelayPlayer extends Player { // If we're sending a chunk, but player isn't yet initialized, wait until it is. // This is wrong and should not be an issue to send chunks before the client // is in the world; need to investigate further, but for now it's fine. - if (name === 'level_chunk' && this.status !== 3) { - this.chunkSendCache.push([name, params]) - return + if (this.status !== 3) { + if (name === 'level_chunk') { + this.chunkSendCache.push([name, params]) + return + } + if (name === 'respawn') this.respawnPacket.push([name, params]) } else if (this.status === 3 && this.chunkSendCache.length) { for (const chunk of this.chunkSendCache) { this.queue(...chunk) } + for (const rp of this.respawnPacket) { + this.queue(...rp) + } this.chunkSendCache = [] + this.respawnPacket = [] } this.queue(name, params) }