mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Entity: replaced motion and lastMotion fields with vectors
This commit is contained in:
@ -1646,8 +1646,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
if(parent::setMotion($motion)){
|
||||
$this->broadcastMotion();
|
||||
|
||||
if($this->motionY > 0){
|
||||
$this->startAirTicks = (-log($this->gravity / ($this->gravity + $this->drag * $this->motionY)) / $this->drag) * 2 + 5;
|
||||
if($this->motion->y > 0){
|
||||
$this->startAirTicks = (-log($this->gravity / ($this->gravity + $this->drag * $this->motion->y)) / $this->drag) * 2 + 5;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1702,7 +1702,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
|
||||
if($this->spawned){
|
||||
$this->processMovement($tickDiff);
|
||||
$this->motionX = $this->motionY = $this->motionZ = 0; //TODO: HACK! (Fixes player knockback being messed up)
|
||||
$this->motion->x = $this->motion->y = $this->motion->z = 0; //TODO: HACK! (Fixes player knockback being messed up)
|
||||
|
||||
Timings::$timerEntityBaseTick->startTiming();
|
||||
$this->entityBaseTick($tickDiff);
|
||||
|
Reference in New Issue
Block a user