From f655eda3b3239d6fbd8186a839308c15b4734fcb Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 23 Oct 2023 16:05:13 +0100 Subject: [PATCH] Player: bypass slow function call for some reason the isSpectator() call here can take upwards of 2 microseconds, for no obvious reason. Subsequent calls are much faster, so I think there's some weird cache thing going on here. --- src/player/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player/Player.php b/src/player/Player.php index 0afa0bffe..0ee9d7dc2 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -1219,7 +1219,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ } protected function checkGroundState(float $wantedX, float $wantedY, float $wantedZ, float $dx, float $dy, float $dz) : void{ - if($this->isSpectator()){ + if($this->gamemode === GameMode::SPECTATOR){ $this->onGround = false; }else{ $bb = clone $this->boundingBox;