Search in sources :

Example 6 with UnderlayDefinition

use of net.runelite.cache.definitions.UnderlayDefinition 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)

Aggregations

UnderlayDefinition (net.runelite.cache.definitions.UnderlayDefinition)6 OverlayDefinition (net.runelite.cache.definitions.OverlayDefinition)2 UnderlayLoader (net.runelite.cache.definitions.loaders.UnderlayLoader)2 Archive (net.runelite.cache.fs.Archive)2 ArchiveFiles (net.runelite.cache.fs.ArchiveFiles)2 FSFile (net.runelite.cache.fs.FSFile)2 Index (net.runelite.cache.fs.Index)2 Storage (net.runelite.cache.fs.Storage)2 Gson (com.google.gson.Gson)1 Color (java.awt.Color)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 InputStreamReader (java.io.InputStreamReader)1 Store (net.runelite.cache.fs.Store)1 InputStream (net.runelite.cache.io.InputStream)1 Region (net.runelite.cache.region.Region)1 Test (org.junit.Test)1