mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 01:39:52 +00:00
Added rotation transformations to remaining packet
This commit is contained in:
parent
63f1a50be4
commit
5bd76e955c
@ -1232,11 +1232,11 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
if($this->onGround){
|
if($this->onGround){
|
||||||
$this->inAirTicks = 0;
|
$this->inAirTicks = 0;
|
||||||
}else{
|
}else{
|
||||||
if($this->inAirTicks > 20 and $this->isSurvival() and !$this->isSleeping() and $this->spawned and !$this->server->getAllowFlight()){
|
if($this->inAirTicks > 20 and $this->isSurvival() and !$this->isSleeping() and $this->spawned){
|
||||||
$expectedVelocity = (-$this->gravity) / $this->drag - ((-$this->gravity) / $this->drag) * exp(-$this->drag * ($this->inAirTicks - 2));
|
$expectedVelocity = (-$this->gravity) / $this->drag - ((-$this->gravity) / $this->drag) * exp(-$this->drag * ($this->inAirTicks - 2));
|
||||||
$diff = ($this->speed->y - $expectedVelocity) ** 2;
|
$diff = ($this->speed->y - $expectedVelocity) ** 2;
|
||||||
|
|
||||||
if($diff > 0.6 and $expectedVelocity < $this->speed->y){
|
if($diff > 0.6 and $expectedVelocity < $this->speed->y and !$this->server->getAllowFlight()){
|
||||||
$this->kick("Flying is not enabled on this server");
|
$this->kick("Flying is not enabled on this server");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -1541,6 +1541,13 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
if($this->spawned === false or $this->dead === true){
|
if($this->spawned === false or $this->dead === true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$packet->yaw %= 360;
|
||||||
|
$packet->pitch %= 360;
|
||||||
|
|
||||||
|
if($packet->yaw < 0){
|
||||||
|
$packet->yaw += 360;
|
||||||
|
}
|
||||||
|
|
||||||
$this->setRotation($packet->yaw, $this->pitch);
|
$this->setRotation($packet->yaw, $this->pitch);
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::MOVE_PLAYER_PACKET:
|
case ProtocolInfo::MOVE_PLAYER_PACKET:
|
||||||
|
@ -243,7 +243,6 @@ class Utils{
|
|||||||
(string) memory_get_usage() . "." . memory_get_peak_usage(),
|
(string) memory_get_usage() . "." . memory_get_peak_usage(),
|
||||||
php_uname(),
|
php_uname(),
|
||||||
phpversion(),
|
phpversion(),
|
||||||
extension_loaded("gmp") ? gmp_strval(gmp_random(4)) : microtime(),
|
|
||||||
zend_version(),
|
zend_version(),
|
||||||
(string) getmypid(),
|
(string) getmypid(),
|
||||||
(string) getmyuid(),
|
(string) getmyuid(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user