From 3a5fc78c53ed8b31a28607f2e1b23efce3cdb39a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 22 Aug 2017 17:47:48 +0100 Subject: [PATCH] Fixed players getting kicked for flying when standing still when blocks near them get updated, fixed item movement being too slippery --- src/pocketmine/entity/Entity.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 7f880ecf79..a6afc6e1cb 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1208,18 +1208,18 @@ abstract class Entity extends Location implements Metadatable{ protected function tryChangeMovement(){ $friction = 1 - $this->drag; - if(!$this->onGround){ - if($this->applyDragBeforeGravity()){ - $this->motionY *= $friction; - } + if($this->applyDragBeforeGravity()){ + $this->motionY *= $friction; + } - $this->applyGravity(); + $this->applyGravity(); - if(!$this->applyDragBeforeGravity()){ - $this->motionY *= $friction; - } - }else{ - $friction = $this->level->getBlock($this->floor()->subtract(0, 1, 0))->getFrictionFactor(); + if(!$this->applyDragBeforeGravity()){ + $this->motionY *= $friction; + } + + if($this->onGround){ + $friction *= $this->level->getBlock($this->floor()->subtract(0, 1, 0))->getFrictionFactor(); } $this->motionX *= $friction; @@ -1311,7 +1311,6 @@ abstract class Entity extends Location implements Metadatable{ */ final public function setForceMovementUpdate(bool $value = true){ $this->forceMovementUpdate = $value; - $this->onGround = false; $this->blocksAround = null; }