mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Merge commit '03e8cd3ed'
# Conflicts: # resources/vanilla # src/pocketmine/Player.php
This commit is contained in:
commit
fcc2352203
@ -1030,9 +1030,17 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
|
||||
if($this->isSpectator()){
|
||||
$this->setFlying(true);
|
||||
}elseif($this->isSurvival()){
|
||||
$this->onGround = false;
|
||||
|
||||
//TODO: HACK! this syncs the onground flag with the client so that flying works properly
|
||||
//this is a yucky hack but we don't have any other options :(
|
||||
$this->sendPosition($this->location, null, null, MovePlayerPacket::MODE_TELEPORT);
|
||||
}else{
|
||||
if($this->isSurvival()){
|
||||
$this->setFlying(false);
|
||||
}
|
||||
$this->checkGroundState(0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1123,12 +1131,16 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
}
|
||||
|
||||
protected function checkGroundState(float $movX, float $movY, float $movZ, float $dx, float $dy, float $dz) : void{
|
||||
if($this->isSpectator()){
|
||||
$this->onGround = false;
|
||||
}else{
|
||||
$bb = clone $this->boundingBox;
|
||||
$bb->minY = $this->location->y - 0.2;
|
||||
$bb->maxY = $this->location->y + 0.2;
|
||||
|
||||
$this->onGround = $this->isCollided = count($this->getWorld()->getCollisionBlocks($bb, true)) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function canBeMovedByCurrents() : bool{
|
||||
return false; //currently has no server-side movement
|
||||
|
Loading…
x
Reference in New Issue
Block a user