Show death message on death screen (#5386)

This commit is contained in:
IvanCraft623
2022-12-22 10:36:31 -05:00
committed by GitHub
parent ee7d4728d8
commit a9e5f92958
3 changed files with 28 additions and 4 deletions

View File

@ -743,9 +743,9 @@ class NetworkSession{
$this->setHandler(new InGamePacketHandler($this->player, $this, $this->invManager));
}
public function onServerDeath() : void{
public function onServerDeath(Translatable|string $deathMessage) : void{
if($this->handler instanceof InGamePacketHandler){ //TODO: this is a bad fix for pre-spawn death, this shouldn't be reachable at all at this stage :(
$this->setHandler(new DeathPacketHandler($this->player, $this, $this->invManager ?? throw new AssumptionFailedError()));
$this->setHandler(new DeathPacketHandler($this->player, $this, $this->invManager ?? throw new AssumptionFailedError(), $deathMessage));
}
}