mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 20:35:15 +00:00
Merge branch 'stable' into next-minor
This commit is contained in:
commit
0ae2c6302a
6
.gitignore
vendored
6
.gitignore
vendored
@ -41,3 +41,9 @@ test_data/*
|
|||||||
|
|
||||||
# Doxygen
|
# Doxygen
|
||||||
Documentation/*
|
Documentation/*
|
||||||
|
|
||||||
|
# PHPUnit
|
||||||
|
/.phpunit.result.cache
|
||||||
|
|
||||||
|
# php-cs-fixer
|
||||||
|
/.php_cs.cache
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit d475b694e4889e403fe430b88be9f535b7d4af02
|
Subproject commit 0aa88d27659c7fa91cb467547fde12dca926529b
|
@ -1379,9 +1379,16 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
if($this->isSpectator()){
|
if($this->isSpectator()){
|
||||||
$this->setFlying(true);
|
$this->setFlying(true);
|
||||||
$this->keepMovement = true;
|
$this->keepMovement = true;
|
||||||
|
$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, null, null, MovePlayerPacket::MODE_TELEPORT);
|
||||||
|
|
||||||
$this->despawnFromAll();
|
$this->despawnFromAll();
|
||||||
}else{
|
}else{
|
||||||
$this->keepMovement = $this->allowMovementCheats;
|
$this->keepMovement = $this->allowMovementCheats;
|
||||||
|
$this->checkGroundState(0, 0, 0, 0, 0, 0);
|
||||||
if($this->isSurvival()){
|
if($this->isSurvival()){
|
||||||
$this->setFlying(false);
|
$this->setFlying(false);
|
||||||
}
|
}
|
||||||
@ -1502,12 +1509,16 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
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{
|
||||||
|
if($this->isSpectator()){
|
||||||
|
$this->onGround = false;
|
||||||
|
}else{
|
||||||
$bb = clone $this->boundingBox;
|
$bb = clone $this->boundingBox;
|
||||||
$bb->minY = $this->y - 0.2;
|
$bb->minY = $this->y - 0.2;
|
||||||
$bb->maxY = $this->y + 0.2;
|
$bb->maxY = $this->y + 0.2;
|
||||||
|
|
||||||
$this->onGround = $this->isCollided = count($this->level->getCollisionBlocks($bb, true)) > 0;
|
$this->onGround = $this->isCollided = count($this->level->getCollisionBlocks($bb, true)) > 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function canBeMovedByCurrents() : bool{
|
public function canBeMovedByCurrents() : bool{
|
||||||
return false; //currently has no server-side movement
|
return false; //currently has no server-side movement
|
||||||
|
@ -2092,17 +2092,24 @@ class Server{
|
|||||||
|
|
||||||
if($report){
|
if($report){
|
||||||
$url = ((bool) $this->getProperty("auto-report.use-https", true) ? "https" : "http") . "://" . $this->getProperty("auto-report.host", "crash.pmmp.io") . "/submit/api";
|
$url = ((bool) $this->getProperty("auto-report.use-https", true) ? "https" : "http") . "://" . $this->getProperty("auto-report.host", "crash.pmmp.io") . "/submit/api";
|
||||||
|
$postUrlError = "Unknown error";
|
||||||
$reply = Internet::postURL($url, [
|
$reply = Internet::postURL($url, [
|
||||||
"report" => "yes",
|
"report" => "yes",
|
||||||
"name" => $this->getName() . " " . $this->getPocketMineVersion(),
|
"name" => $this->getName() . " " . $this->getPocketMineVersion(),
|
||||||
"email" => "crash@pocketmine.net",
|
"email" => "crash@pocketmine.net",
|
||||||
"reportPaste" => base64_encode($dump->getEncodedData())
|
"reportPaste" => base64_encode($dump->getEncodedData())
|
||||||
]);
|
], 10, [], $postUrlError);
|
||||||
|
|
||||||
if($reply !== false and ($data = json_decode($reply)) !== null and isset($data->crashId) and isset($data->crashUrl)){
|
if($reply !== false and ($data = json_decode($reply)) !== null){
|
||||||
|
if(isset($data->crashId) and isset($data->crashUrl)){
|
||||||
$reportId = $data->crashId;
|
$reportId = $data->crashId;
|
||||||
$reportUrl = $data->crashUrl;
|
$reportUrl = $data->crashUrl;
|
||||||
$this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId]));
|
$this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId]));
|
||||||
|
}elseif(isset($data->error)){
|
||||||
|
$this->logger->emergency("Automatic crash report submission failed: $data->error");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$this->logger->emergency("Failed to communicate with crash archive: $postUrlError");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1868,7 +1868,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
|||||||
$this->setMotion($this->temporalVector->setComponents(0, 0, 0));
|
$this->setMotion($this->temporalVector->setComponents(0, 0, 0));
|
||||||
if($this->setPositionAndRotation($pos, $yaw ?? $this->yaw, $pitch ?? $this->pitch)){
|
if($this->setPositionAndRotation($pos, $yaw ?? $this->yaw, $pitch ?? $this->pitch)){
|
||||||
$this->resetFallDistance();
|
$this->resetFallDistance();
|
||||||
$this->onGround = true;
|
$this->setForceMovementUpdate();
|
||||||
|
|
||||||
$this->updateMovement(true);
|
$this->updateMovement(true);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user