bow power algorithm is implemented(statically set to 1sec before launch now), direct arrow move updates sending

This commit is contained in:
GameHerobrine 2023-07-05 10:10:06 +03:00
parent 4de7707532
commit 78a19a7da6
2 changed files with 34 additions and 2 deletions

View file

@ -41,7 +41,20 @@ class Arrow extends Projectile{
$this->update();
//TODO i guess? $ticksInGround = 0;
}
public function sendMoveUpdate()
{
$pk = new MoveEntityPacket_PosRot();
$pk->eid = $this->eid;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
foreach($this->level->players as $p){ //sending packets directly makes movement less laggy
$p->directDataPacket(clone $pk);
}
}
public function update(){
//parent::update();
$this->needsUpdate = true;