use of net.runelite.cache.definitions.loaders.ObjectLoader in project runelite by runelite.
the class ObjectManager method load.
public void load() throws IOException {
ObjectLoader loader = new ObjectLoader();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.CONFIGS);
Archive archive = index.getArchive(ConfigType.OBJECT.getId());
byte[] archiveData = storage.loadArchive(archive);
ArchiveFiles files = archive.getFiles(archiveData);
for (FSFile f : files.getFiles()) {
ObjectDefinition def = loader.load(f.getFileId(), f.getContents());
objects.put(f.getFileId(), def);
}
}
use of net.runelite.cache.definitions.loaders.ObjectLoader in project runelite by runelite.
the class CacheController method getObject.
@RequestMapping("object/{objectId}")
public ObjectDefinition getObject(@PathVariable int objectId) throws IOException {
ArchiveEntry archiveEntry = findConfig(ConfigType.OBJECT);
ArchiveFiles archiveFiles = cacheService.getArchiveFiles(archiveEntry);
if (archiveFiles == null) {
throw new NotFoundException();
}
FSFile file = archiveFiles.findFile(objectId);
if (file == null) {
throw new NotFoundException();
}
ObjectDefinition objectdef = new ObjectLoader().load(objectId, file.getContents());
return objectdef;
}
Aggregations