From 2091dd1a98e7b3dd7758e1c02815535352135983 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Sun, 24 Nov 2024 23:27:14 +0300 Subject: [PATCH] fixed spam when switching gm to survival, fixed flykick after death --- src/Player.php | 1 + src/entity/Entity.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Player.php b/src/Player.php index 2f0217fd..61f512bc 100755 --- a/src/Player.php +++ b/src/Player.php @@ -1087,6 +1087,7 @@ class Player{ foreach($this->inventory as $slot => $item){ $inv[$slot] = BlockAPI::getItem(AIR, 0, 0); } + $this->hotbar = [0, 1, 2, 3, 4, 5, 6, 7, 8]; $this->lastCorrect = $this->entity->copy(); $this->blocked = true; $this->gamemode = $gm; diff --git a/src/entity/Entity.php b/src/entity/Entity.php index ee68991c..1b640119 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -821,7 +821,7 @@ class Entity extends Position } } - if($prevGroundState == $this->onGround && !$this->onGround && $this->player->isSleeping == false){ //isSleeping may be a vector + if($prevGroundState == $this->onGround && !$this->onGround && $this->player->isSleeping == false && !$this->dead){ //isSleeping may be a vector ++$this->notOnGroundTicks; }else if($this->onGround){ $this->notOnGroundTicks = 0;