Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor
2021-10-29 19:04:01 +01:00
4 changed files with 11 additions and 3 deletions

View File

@ -1436,6 +1436,9 @@ abstract class Entity{
}
public function spawnTo(Player $player) : void{
if($player->getWorld() !== $this->getWorld()){
throw new \InvalidArgumentException("Player is not in the same world");
}
$id = spl_object_id($player);
//TODO: this will cause some visible lag during chunk resends; if the player uses a spawn egg in a chunk, the
//created entity won't be visible until after the resend arrives. However, this is better than possibly crashing