use of net.runelite.cache.definitions.sound.SoundEffectDefinition in project runelite by runelite.
the class SoundEffectsDumperTest method test.
@Test
public void test() throws IOException {
File dumpDir = folder.newFolder();
int count = 0;
try (Store store = new Store(StoreLocation.LOCATION)) {
store.load();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.SOUNDEFFECTS);
for (Archive archive : index.getArchives()) {
byte[] contents = archive.decompress(storage.loadArchive(archive));
SoundEffectLoader soundEffectLoader = new SoundEffectLoader();
SoundEffectDefinition soundEffect = soundEffectLoader.load(contents);
Files.write(gson.toJson(soundEffect), new File(dumpDir, archive.getArchiveId() + ".json"), Charset.defaultCharset());
++count;
}
}
logger.info("Dumped {} sound effects to {}", count, dumpDir);
}
use of net.runelite.cache.definitions.sound.SoundEffectDefinition in project runelite by runelite.
the class SoundEffectLoader method load.
public SoundEffectDefinition load(byte[] b) {
SoundEffectDefinition se = new SoundEffectDefinition();
InputStream in = new InputStream(b);
load(se, in);
return se;
}
Aggregations