arrow speed depends on how long were u using an item

This commit is contained in:
GameHerobrine 2023-07-05 10:30:55 +03:00
parent 78a19a7da6
commit d8e242d0b5
3 changed files with 29 additions and 12 deletions

View file

@ -70,6 +70,7 @@ class Entity extends Position
public $random;
public $radius;
public $inAction = false;
public $inActionCounter = 0;
public $hasKnockback;
public $hasJumped;
public $invincible, $crouched, $fire, $health, $status;
@ -499,6 +500,7 @@ class Entity extends Position
if($this->closed === true){
return false;
}
$now = microtime(true);
if($this->check === false){
$this->lastUpdate = $now;
@ -727,19 +729,27 @@ class Entity extends Position
$hasUpdate = true;
}
}
if($this->knockbackTime > 0){
--$this->knockbackTime;
}
if($this->moveTime > 0){
-- $this->moveTime;
--$this->moveTime;
}
if($this->lookTime > 0){
-- $this->lookTime;
--$this->lookTime;
}
if($this->idleTime > 0){
-- $this->idleTime;
--$this->idleTime;
}
if($this->inAction){
++$this->inActionCounter;
}
if($this->lastHeadYaw != $this->headYaw){
$this->sendHeadYaw();
}