Search in sources :

Example 21 with ArchiveFiles

use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.

the class ItemManager method load.

public void load() throws IOException {
    ItemLoader loader = new ItemLoader();
    Storage storage = store.getStorage();
    Index index = store.getIndex(IndexType.CONFIGS);
    Archive archive = index.getArchive(ConfigType.ITEM.getId());
    byte[] archiveData = storage.loadArchive(archive);
    ArchiveFiles files = archive.getFiles(archiveData);
    for (FSFile f : files.getFiles()) {
        ItemDefinition def = loader.load(f.getFileId(), f.getContents());
        items.put(f.getFileId(), def);
    }
}
Also used : Storage(net.runelite.cache.fs.Storage) Archive(net.runelite.cache.fs.Archive) ArchiveFiles(net.runelite.cache.fs.ArchiveFiles) ItemDefinition(net.runelite.cache.definitions.ItemDefinition) Index(net.runelite.cache.fs.Index) ItemLoader(net.runelite.cache.definitions.loaders.ItemLoader) FSFile(net.runelite.cache.fs.FSFile)

Example 22 with ArchiveFiles

use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.

the class MapImageDumper method loadUnderlays.

private void loadUnderlays(Store store) throws IOException {
    Storage storage = store.getStorage();
    Index index = store.getIndex(IndexType.CONFIGS);
    Archive archive = index.getArchive(ConfigType.UNDERLAY.getId());
    byte[] archiveData = storage.loadArchive(archive);
    ArchiveFiles files = archive.getFiles(archiveData);
    for (FSFile file : files.getFiles()) {
        UnderlayLoader loader = new UnderlayLoader();
        UnderlayDefinition underlay = loader.load(file.getFileId(), file.getContents());
        underlays.put(underlay.getId(), underlay);
    }
}
Also used : Storage(net.runelite.cache.fs.Storage) Archive(net.runelite.cache.fs.Archive) ArchiveFiles(net.runelite.cache.fs.ArchiveFiles) UnderlayDefinition(net.runelite.cache.definitions.UnderlayDefinition) Index(net.runelite.cache.fs.Index) UnderlayLoader(net.runelite.cache.definitions.loaders.UnderlayLoader) FSFile(net.runelite.cache.fs.FSFile)

Example 23 with ArchiveFiles

use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.

the class MapImageDumper method loadOverlays.

private void loadOverlays(Store store) throws IOException {
    Storage storage = store.getStorage();
    Index index = store.getIndex(IndexType.CONFIGS);
    Archive archive = index.getArchive(ConfigType.OVERLAY.getId());
    byte[] archiveData = storage.loadArchive(archive);
    ArchiveFiles files = archive.getFiles(archiveData);
    for (FSFile file : files.getFiles()) {
        OverlayLoader loader = new OverlayLoader();
        OverlayDefinition overlay = loader.load(file.getFileId(), file.getContents());
        overlays.put(overlay.getId(), overlay);
    }
}
Also used : Storage(net.runelite.cache.fs.Storage) Archive(net.runelite.cache.fs.Archive) ArchiveFiles(net.runelite.cache.fs.ArchiveFiles) OverlayDefinition(net.runelite.cache.definitions.OverlayDefinition) Index(net.runelite.cache.fs.Index) OverlayLoader(net.runelite.cache.definitions.loaders.OverlayLoader) FSFile(net.runelite.cache.fs.FSFile)

Example 24 with ArchiveFiles

use of net.runelite.cache.fs.ArchiveFiles in project runelite by runelite.

the class AreaManager method load.

public void load() throws IOException {
    Storage storage = store.getStorage();
    Index index = store.getIndex(IndexType.CONFIGS);
    Archive archive = index.getArchive(ConfigType.AREA.getId());
    byte[] archiveData = storage.loadArchive(archive);
    ArchiveFiles files = archive.getFiles(archiveData);
    for (FSFile file : files.getFiles()) {
        AreaLoader loader = new AreaLoader();
        AreaDefinition area = loader.load(file.getContents(), file.getFileId());
        areas.put(area.id, area);
    }
}
Also used : AreaDefinition(net.runelite.cache.definitions.AreaDefinition) Storage(net.runelite.cache.fs.Storage) Archive(net.runelite.cache.fs.Archive) ArchiveFiles(net.runelite.cache.fs.ArchiveFiles) Index(net.runelite.cache.fs.Index) AreaLoader(net.runelite.cache.definitions.loaders.AreaLoader) FSFile(net.runelite.cache.fs.FSFile)

Aggregations

ArchiveFiles (net.runelite.cache.fs.ArchiveFiles)24 FSFile (net.runelite.cache.fs.FSFile)24 Archive (net.runelite.cache.fs.Archive)18 Index (net.runelite.cache.fs.Index)18 Storage (net.runelite.cache.fs.Storage)18 File (java.io.File)9 Store (net.runelite.cache.fs.Store)9 Test (org.junit.Test)9 ArchiveEntry (net.runelite.http.service.cache.beans.ArchiveEntry)5 NotFoundException (net.runelite.http.service.util.exception.NotFoundException)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 InterfaceDefinition (net.runelite.cache.definitions.InterfaceDefinition)2 InventoryDefinition (net.runelite.cache.definitions.InventoryDefinition)2 ItemDefinition (net.runelite.cache.definitions.ItemDefinition)2 NpcDefinition (net.runelite.cache.definitions.NpcDefinition)2 ObjectDefinition (net.runelite.cache.definitions.ObjectDefinition)2 OverlayDefinition (net.runelite.cache.definitions.OverlayDefinition)2 SpriteDefinition (net.runelite.cache.definitions.SpriteDefinition)2 TextureDefinition (net.runelite.cache.definitions.TextureDefinition)2 UnderlayDefinition (net.runelite.cache.definitions.UnderlayDefinition)2