use of net.runelite.cache.fs.Store in project runelite by runelite.
the class MapDumperTest method dunpJson.
@Test
@Ignore
public void dunpJson() throws IOException {
File base = StoreLocation.LOCATION, outDir = folder.newFolder();
try (Store store = new Store(base)) {
store.load();
Map<MapDefinition, LocationsDefinition> regions = loadRegions(store);
for (Entry<MapDefinition, LocationsDefinition> entry : regions.entrySet()) {
MapDefinition key = entry.getKey();
LocationsDefinition value = entry.getValue();
int x = key.getRegionX();
int y = key.getRegionY();
Files.write(gson.toJson(key).getBytes(), new File(outDir, "m" + x + "_" + y + ".json"));
if (value != null) {
Files.write(gson.toJson(value).getBytes(), new File(outDir, "l" + x + "_" + y + ".json"));
}
}
}
logger.info("Dumped regions to {}", outDir);
}
use of net.runelite.cache.fs.Store in project runelite by runelite.
the class ModelDumperTest method test.
@Test
public void test() throws IOException {
File modelDir = folder.newFolder("models");
int count = 0;
try (Store store = new Store(StoreLocation.LOCATION)) {
store.load();
Storage storage = store.getStorage();
Index index = store.getIndex(IndexType.MODELS);
for (Archive archive : index.getArchives()) {
byte[] contents = archive.decompress(storage.loadArchive(archive));
ModelLoader loader = new ModelLoader();
loader.load(archive.getArchiveId(), contents);
Files.write(contents, new File(modelDir, archive.getArchiveId() + ".model"));
++count;
}
}
logger.info("Dumped {} models to {}", count, modelDir);
}
use of net.runelite.cache.fs.Store in project runelite by runelite.
the class ObjectManagerTest method test.
@Test
public void test() throws IOException {
File dumpDir = folder.newFolder(), javaDir = folder.newFolder();
try (Store store = new Store(StoreLocation.LOCATION)) {
store.load();
ObjectManager dumper = new ObjectManager(store);
dumper.load();
dumper.dump(dumpDir);
dumper.java(javaDir);
}
logger.info("Dumped to {}, java {}", dumpDir, javaDir);
}
use of net.runelite.cache.fs.Store in project runelite by runelite.
the class HeightMapDumperTest method extract.
// @Test
public void extract() throws IOException {
File base = StoreLocation.LOCATION, outDir = folder.newFolder();
try (Store store = new Store(base)) {
store.load();
HeightMapDumper dumper = new HeightMapDumper(store);
dumper.load();
BufferedImage image = dumper.drawHeightMap(0);
File imageFile = new File(outDir, "heightmap-0.png");
ImageIO.write(image, "png", imageFile);
logger.info("Wrote image {}", imageFile);
}
}
use of net.runelite.cache.fs.Store in project runelite by runelite.
the class MapImageDumperTest method dumpMap.
@Test
@Ignore
public void dumpMap() throws IOException {
File base = StoreLocation.LOCATION, outDir = folder.newFolder();
try (Store store = new Store(base)) {
store.load();
MapImageDumper dumper = new MapImageDumper(store);
dumper.load();
for (int i = 0; i < Region.Z; ++i) {
BufferedImage image = dumper.drawMap(i);
File imageFile = new File(outDir, "img-" + i + ".png");
ImageIO.write(image, "png", imageFile);
logger.info("Wrote image {}", imageFile);
}
}
}
Aggregations