added separated class for arrows

This commit is contained in:
GameHerobrine 2022-06-26 06:03:19 +03:00
parent fa41b2ed65
commit 577e00378e
4 changed files with 49 additions and 19 deletions

View file

@ -142,7 +142,7 @@ class Entity extends Position{
$this->setHealth(10000000, "generic");
$this->server->schedule(5, array($this, "updateFuse"), array(), true);
$this->update();
}elseif($this->type === (OBJECT_ARROW or OBJECT_SNOWBALL)){
}elseif($this->type === OBJECT_SNOWBALL){
$this->server->schedule(1210, array($this, "update")); //Despawn
$this->update();
}elseif($this->type == OBJECT_MINECART){
@ -241,9 +241,9 @@ class Entity extends Position{
$this->close(); //Despawn timer
return false;
}
}elseif($this->class === ENTITY_OBJECT and ($this->type === OBJECT_ARROW or OBJECT_SNOWBALL)){
}elseif($this->class === ENTITY_OBJECT and $this->type === OBJECT_SNOWBALL){
if(($time - $this->spawntime) >= 60){
$this->close(); //Despawn timer
$this->close();
return false;
}
}
@ -730,22 +730,6 @@ class Entity extends Position{
$pk->did = 0;
$player->dataPacket($pk);
$pk = new SetEntityMotionPacket;
$pk->eid = $this->eid;
$pk->speedX = $this->speedX;
$pk->speedY = $this->speedY;
$pk->speedZ = $this->speedZ;
$player->dataPacket($pk);
}elseif($this->type === OBJECT_ARROW){
$pk = new AddEntityPacket;
$pk->eid = $this->eid;
$pk->type = $this->type;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->did = 0;
$player->dataPacket($pk);
$pk = new SetEntityMotionPacket;
$pk->eid = $this->eid;
$pk->speedX = $this->speedX;