Fixed players getting kicked for flying when standing still when blocks near them get updated, fixed item movement being too slippery

This commit is contained in:
Dylan K. Taylor 2017-08-22 17:47:48 +01:00
parent 50580f4408
commit 3a5fc78c53

View File

@ -1208,7 +1208,6 @@ abstract class Entity extends Location implements Metadatable{
protected function tryChangeMovement(){ protected function tryChangeMovement(){
$friction = 1 - $this->drag; $friction = 1 - $this->drag;
if(!$this->onGround){
if($this->applyDragBeforeGravity()){ if($this->applyDragBeforeGravity()){
$this->motionY *= $friction; $this->motionY *= $friction;
} }
@ -1218,8 +1217,9 @@ abstract class Entity extends Location implements Metadatable{
if(!$this->applyDragBeforeGravity()){ if(!$this->applyDragBeforeGravity()){
$this->motionY *= $friction; $this->motionY *= $friction;
} }
}else{
$friction = $this->level->getBlock($this->floor()->subtract(0, 1, 0))->getFrictionFactor(); if($this->onGround){
$friction *= $this->level->getBlock($this->floor()->subtract(0, 1, 0))->getFrictionFactor();
} }
$this->motionX *= $friction; $this->motionX *= $friction;
@ -1311,7 +1311,6 @@ abstract class Entity extends Location implements Metadatable{
*/ */
final public function setForceMovementUpdate(bool $value = true){ final public function setForceMovementUpdate(bool $value = true){
$this->forceMovementUpdate = $value; $this->forceMovementUpdate = $value;
$this->onGround = false;
$this->blocksAround = null; $this->blocksAround = null;
} }