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.
This commit is contained in:
Dylan K. Taylor 2023-10-23 16:05:13 +01:00
parent af432c1a7f
commit f655eda3b3
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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;