mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
Fixes
This commit is contained in:
parent
9dbdab8060
commit
c9cecaf218
@ -1108,13 +1108,13 @@ class Player{
|
|||||||
if($this->entity->dead === false){
|
if($this->entity->dead === false){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->blocked = false;
|
|
||||||
$this->entity->fire = 0;
|
$this->entity->fire = 0;
|
||||||
$this->entity->air = 300;
|
$this->entity->air = 300;
|
||||||
$this->entity->setHealth(20, "respawn");
|
$this->entity->setHealth(20, "respawn");
|
||||||
$this->entity->updateMetadata();
|
$this->entity->updateMetadata();
|
||||||
$this->sendInventory();
|
$this->sendInventory();
|
||||||
$this->teleport($this->spawnPosition);
|
$this->teleport($this->spawnPosition);
|
||||||
|
$this->blocked = false;
|
||||||
break;
|
break;
|
||||||
case MC_SET_HEALTH:
|
case MC_SET_HEALTH:
|
||||||
if($this->spawned === false){
|
if($this->spawned === false){
|
||||||
|
@ -589,8 +589,8 @@ class Entity extends Position{
|
|||||||
|
|
||||||
public function calculateVelocity(){
|
public function calculateVelocity(){
|
||||||
$diffTime = max(0.05, abs(microtime(true) - $this->last[5]));
|
$diffTime = max(0.05, abs(microtime(true) - $this->last[5]));
|
||||||
$origin = new Vector3($this->last[0], $this->last[2]);
|
$origin = new Vector2($this->last[0], $this->last[2]);
|
||||||
$final = new Vector3($this->x, $this->z);
|
$final = new Vector2($this->x, $this->z);
|
||||||
$speedX = ($this->last[0] - $this->x) / $diffTime;
|
$speedX = ($this->last[0] - $this->x) / $diffTime;
|
||||||
$speedY = ($this->last[1] - $this->y) / $diffTime;
|
$speedY = ($this->last[1] - $this->y) / $diffTime;
|
||||||
$speedZ = ($this->last[2] - $this->z) / $diffTime;
|
$speedZ = ($this->last[2] - $this->z) / $diffTime;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user