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()]);
}
}
}
}