use of net.runelite.cache.fs.Store in project runelite by runelite.
the class SpriteManagerTest method test.
@Test
public void test() throws IOException {
File dumpDir = folder.newFolder();
try (Store store = new Store(StoreLocation.LOCATION)) {
store.load();
SpriteManager dumper = new SpriteManager(store);
dumper.load();
dumper.export(dumpDir);
}
logger.info("Dumped to {}", dumpDir);
}
use of net.runelite.cache.fs.Store in project runelite by runelite.
the class TrackDumperTest method test.
@Test
public void test() throws IOException {
File dumpDir1 = folder.newFolder(), dumpDir2 = folder.newFolder();
int idx1 = 0, idx2 = 0;
djb2.load();
try (Store store = new Store(StoreLocation.LOCATION)) {
store.load();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.TRACK1);
Index index2 = store.getIndex(IndexType.TRACK2);
for (Archive archive : index.getArchives()) {
dumpTrackArchive(dumpDir1, storage, archive);
++idx1;
}
for (Archive archive : index2.getArchives()) {
dumpTrackArchive(dumpDir2, storage, archive);
++idx2;
}
}
logger.info("Dumped {} sound tracks ({} idx1, {} idx2) to {} and {}", idx1 + idx2, idx1, idx2, dumpDir1, dumpDir2);
}
use of net.runelite.cache.fs.Store in project runelite by runelite.
the class TextureDumper method extract.
@Test
public void extract() throws IOException {
File base = StoreLocation.LOCATION, outDir = folder.newFolder();
int count = 0;
try (Store store = new Store(base)) {
store.load();
TextureManager tm = new TextureManager(store);
tm.load();
for (TextureDefinition texture : tm.getTextures()) {
Files.write(gson.toJson(texture), new File(outDir, texture.getId() + ".json"), Charset.defaultCharset());
++count;
}
}
logger.info("Dumped {} textures to {}", count, outDir);
}
use of net.runelite.cache.fs.Store in project runelite by runelite.
the class TitleDumper method extract.
@Test
public void extract() throws IOException {
File base = StoreLocation.LOCATION, outFile = folder.newFolder();
try (Store store = new Store(base)) {
store.load();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.BINARY);
Archive archive = index.findArchiveByName("title.jpg");
byte[] contents = archive.decompress(storage.loadArchive(archive));
Files.write(outFile.toPath(), contents);
}
logger.info("Dumped to {}", outFile);
}
use of net.runelite.cache.fs.Store in project runelite by runelite.
the class UnderlayDumper method extract.
@Test
public void extract() throws IOException {
File base = StoreLocation.LOCATION, outDir = folder.newFolder();
int count = 0;
try (Store store = new Store(base)) {
store.load();
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());
Files.write(gson.toJson(underlay), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset());
++count;
}
}
logger.info("Dumped {} underlays to {}", count, outDir);
}
Aggregations