use of org.pepsoft.worldpainter.UnloadableWorldException in project WorldPainter by Captain-Chaos.
the class GetWorldOp method go.
@Override
public World2 go() throws ScriptException {
goCalled();
File file = sanityCheckFileName(fileName);
WorldIO worldIO = new WorldIO();
try {
worldIO.load(new FileInputStream(file));
} catch (IOException e) {
throw new ScriptException("I/O error while loading world " + fileName, e);
} catch (UnloadableWorldException e) {
throw new ScriptException("Unloadable world " + fileName + " (not a WorldPainter world?)", e);
}
return worldIO.getWorld();
}
Aggregations