mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 07:55:31 +00:00
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:
parent
50580f4408
commit
3a5fc78c53
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user