Removes the entity from the level index
public removeEntity ( |
||
$entity |
public function onUnload(ChunkUnloadEvent $event) { if ($event->getLevel() === $this->level) { foreach ($this->locs[Level::chunkHash($event->getChunk()->getX(), $event->getChunk()->getZ())] as $id => $spawn) { if (isset($this->spawns[$spawn->getId()])) { $this->level->removeEntity($this->spawns[$spawn->getId()]); } } } }