use of org.pepsoft.worldpainter.exporting.WorldExporter in project WorldPainter by Captain-Chaos.
the class ExportProgressDialog method getTask.
@Override
protected ProgressTask<Map<Integer, ChunkFactory.Stats>> getTask() {
return new ProgressTask<Map<Integer, ChunkFactory.Stats>>() {
@Override
public String getName() {
return "Exporting world " + name;
}
@Override
public Map<Integer, ChunkFactory.Stats> execute(ProgressReceiver progressReceiver) throws OperationCancelled {
progressReceiver = new TaskbarProgressReceiver(App.getInstance(), progressReceiver);
progressReceiver.setMessage("Exporting world " + name);
WorldExporter exporter = PlatformManager.getInstance().getExporter(world);
try {
backupDir = exporter.selectBackupDir(new File(baseDir, FileUtils.sanitiseName(name)));
return exporter.export(baseDir, name, backupDir, progressReceiver);
} catch (IOException e) {
throw new RuntimeException("I/O error while exporting world", e);
}
}
};
}
Aggregations