mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Merge branch 'minor-next' into major-next
This commit is contained in:
@ -1214,6 +1214,15 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
* @param Vector3 $newPos Coordinates of the player's feet, centered horizontally at the base of their bounding box.
|
||||
*/
|
||||
public function handleMovement(Vector3 $newPos) : void{
|
||||
Timings::$playerMove->startTiming();
|
||||
try{
|
||||
$this->actuallyHandleMovement($newPos);
|
||||
}finally{
|
||||
Timings::$playerMove->stopTiming();
|
||||
}
|
||||
}
|
||||
|
||||
private function actuallyHandleMovement(Vector3 $newPos) : void{
|
||||
$this->moveRateLimit--;
|
||||
if($this->moveRateLimit < 0){
|
||||
return;
|
||||
@ -1367,13 +1376,15 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
$this->timings->startTiming();
|
||||
|
||||
if($this->spawned){
|
||||
Timings::$playerMove->startTiming();
|
||||
$this->processMostRecentMovements();
|
||||
$this->motion = new Vector3(0, 0, 0); //TODO: HACK! (Fixes player knockback being messed up)
|
||||
$this->motion = Vector3::zero(); //TODO: HACK! (Fixes player knockback being messed up)
|
||||
if($this->onGround){
|
||||
$this->inAirTicks = 0;
|
||||
}else{
|
||||
$this->inAirTicks += $tickDiff;
|
||||
}
|
||||
Timings::$playerMove->stopTiming();
|
||||
|
||||
Timings::$entityBaseTick->startTiming();
|
||||
$this->entityBaseTick($tickDiff);
|
||||
|
Reference in New Issue
Block a user