mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Fixed speed limiter
This commit is contained in:
parent
9db1b741a7
commit
8515e7ff33
@ -1322,7 +1322,7 @@ class Player{
|
||||
}
|
||||
}
|
||||
$speed = $this->entity->getSpeedMeasure();
|
||||
if($this->blocked === true or ($this->server->api->getProperty("allow-flight") !== true and (($speed > 7 and ($this->gamemode & 0x01) === 0x00) or $speed > 15)) or $this->server->api->handle("player.move", $this->entity) === false){
|
||||
if($this->blocked === true or ($this->server->api->getProperty("allow-flight") !== true and (($speed > 9 and ($this->gamemode & 0x01) === 0x00) or $speed > 20)) or $this->server->api->handle("player.move", $this->entity) === false){
|
||||
if($this->lastCorrect instanceof Vector3){
|
||||
$this->teleport($this->lastCorrect, $this->entity->yaw, $this->entity->pitch, false);
|
||||
}
|
||||
|
@ -507,13 +507,14 @@ class Entity extends Position{
|
||||
}
|
||||
}
|
||||
|
||||
$this->lastUpdate = $now;
|
||||
|
||||
if($this->class !== ENTITY_PLAYER){
|
||||
$this->updateMovement();
|
||||
if($hasUpdate === true){
|
||||
$this->server->schedule(5, array($this, "update"));
|
||||
}
|
||||
}
|
||||
$this->lastUpdate = $now;
|
||||
}
|
||||
|
||||
public function updateMovement(){
|
||||
@ -548,6 +549,7 @@ class Entity extends Position{
|
||||
$this->updatePosition($this->x, $this->y, $this->z, $this->yaw, $this->pitch);
|
||||
}
|
||||
}
|
||||
$this->lastUpdate = $now;
|
||||
}
|
||||
|
||||
public function getDirection(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user