cache: update world map dumper for Areas
This commit is contained in:
@@ -31,10 +31,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import net.runelite.cache.definitions.AreaDefinition;
|
||||
import net.runelite.cache.definitions.loaders.AreaLoader;
|
||||
import net.runelite.cache.fs.Archive;
|
||||
import net.runelite.cache.fs.FSFile;
|
||||
import net.runelite.cache.fs.Index;
|
||||
import net.runelite.cache.fs.Store;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@@ -63,15 +59,12 @@ public class AreaDumper
|
||||
{
|
||||
store.load();
|
||||
|
||||
Index index = store.getIndex(IndexType.CONFIGS);
|
||||
Archive archive = index.getArchive(ConfigType.AREA.getId());
|
||||
AreaManager areaManager = new AreaManager(store);
|
||||
areaManager.load();
|
||||
|
||||
for (FSFile file : archive.getFiles())
|
||||
for (AreaDefinition area : areaManager.getAreas())
|
||||
{
|
||||
AreaLoader loader = new AreaLoader();
|
||||
AreaDefinition area = loader.load(file.getContents(), file.getFileId());
|
||||
|
||||
Files.write(gson.toJson(area), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset());
|
||||
Files.write(gson.toJson(area), new File(outDir, area.id + ".json"), Charset.defaultCharset());
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user