use of net.runelite.cache.definitions.loaders.NpcLoader in project runelite by runelite.
the class NpcManager method load.
public void load() throws IOException {
NpcLoader loader = new NpcLoader();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.CONFIGS);
Archive archive = index.getArchive(ConfigType.NPC.getId());
byte[] archiveData = storage.loadArchive(archive);
ArchiveFiles files = archive.getFiles(archiveData);
for (FSFile f : files.getFiles()) {
NpcDefinition npc = loader.load(f.getFileId(), f.getContents());
npcs.add(npc);
}
}
use of net.runelite.cache.definitions.loaders.NpcLoader in project runelite by runelite.
the class CacheController method getNpc.
@RequestMapping("npc/{npcId}")
public NpcDefinition getNpc(@PathVariable int npcId) throws IOException {
ArchiveEntry archiveEntry = findConfig(ConfigType.NPC);
ArchiveFiles archiveFiles = cacheService.getArchiveFiles(archiveEntry);
if (archiveFiles == null) {
throw new NotFoundException();
}
FSFile file = archiveFiles.findFile(npcId);
if (file == null) {
throw new NotFoundException();
}
NpcDefinition npcdef = new NpcLoader().load(npcId, file.getContents());
return npcdef;
}
Aggregations