better(?) way to handle eid translation, local eid 0 is not used now, some additional fixes

This commit is contained in:
GameHerobrine 2025-06-29 03:12:24 +03:00
parent 62819f8b12
commit 21f8796e89
32 changed files with 345 additions and 56 deletions

View file

@ -17,5 +17,13 @@ class SetEntityDataPacket extends RakNetDataPacket{
$this->putInt($this->eid);
$this->put(Utils::writeMetadata($this->metadata));
}
public function eidsToLocal(Player $p){
if(!$this->localEids){
$this->localEids = true;
$this->eid = $p->global2localEID[$this->eid] ?? false;
if($this->eid === false) return false;
}
return true;
}
}