mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added correct handling of RemovePlayer packet for in-game player list
This commit is contained in:
parent
d26d657b95
commit
7102787aa9
4 changed files with 118 additions and 33 deletions
|
|
@ -148,7 +148,9 @@ class EntityAPI{
|
|||
|
||||
public function spawnAll(Player $player){
|
||||
foreach($this->getAll($player->level) as $e){
|
||||
$e->spawn($player);
|
||||
if($e->class !== ENTITY_PLAYER){
|
||||
$e->spawn($player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -159,6 +161,16 @@ class EntityAPI{
|
|||
unset($this->entities[$eid]);
|
||||
$entity->closed = true;
|
||||
$this->server->query("DELETE FROM entities WHERE EID = ".$eid.";");
|
||||
if($entity->class === ENTITY_PLAYER){
|
||||
$this->server->api->player->broadcastPacket($this->server->api->player->getAll($entity->level), MC_REMOVE_PLAYER, array(
|
||||
"clientID" => 0,
|
||||
"eid" => $entity->eid,
|
||||
));
|
||||
}else{
|
||||
$this->server->api->player->broadcastPacket($this->server->api->player->getAll($entity->level), MC_REMOVE_ENTITY, array(
|
||||
"eid" => $entity->eid,
|
||||
));
|
||||
}
|
||||
$this->server->api->dhandle("entity.remove", $entity);
|
||||
$entity = null;
|
||||
unset($entity);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue