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,8 +1030,16 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
|||||||
|
|
||||||
if($this->isSpectator()){
|
if($this->isSpectator()){
|
||||||
$this->setFlying(true);
|
$this->setFlying(true);
|
||||||
}elseif($this->isSurvival()){
|
$this->onGround = false;
|
||||||
$this->setFlying(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,11 +1131,15 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function checkGroundState(float $movX, float $movY, float $movZ, float $dx, float $dy, float $dz) : void{
|
protected function checkGroundState(float $movX, float $movY, float $movZ, float $dx, float $dy, float $dz) : void{
|
||||||
$bb = clone $this->boundingBox;
|
if($this->isSpectator()){
|
||||||
$bb->minY = $this->location->y - 0.2;
|
$this->onGround = false;
|
||||||
$bb->maxY = $this->location->y + 0.2;
|
}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;
|
$this->onGround = $this->isCollided = count($this->getWorld()->getCollisionBlocks($bb, true)) > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canBeMovedByCurrents() : bool{
|
public function canBeMovedByCurrents() : bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user