public function onLoadChunk(ChunkLoadEvent $event) { if ($event->getLevel()->getName() !== "world_pvp") { return; } $chunk = $event->getChunk(); $hash = Level::chunkHash($chunk->getX(), $chunk->getZ()); if (isset($this->modelLocs[$hash])) { foreach ($this->modelLocs[$hash] as $id => $loc) { $model = new PvpKitModel($this->game, $id, $loc); $model->spawnToAll(); $this->models[$id] = $model; } } if (isset($this->shopLocs[$hash])) { foreach ($this->shopLocs[$hash] as $col => $loc) { $shop = new PvpUpgradeDummyShop($this->game, $loc, $col); $shop->spawnToAll(); $this->shops[$col] = $shop; } } if ($hash === $this->bowHash) { $this->bow = new PvpBowHolder(Settings::kitpvp_getBowLocation($this->game->getMain()->getServer()), $this->game); } }