load .we with layers
- and fix some bug : max is within range ( perhaps not as many as those added ...) - quick hack in CharProvider to skip spaces ... ( bad it applies to strings too ...)
This commit is contained in:
@@ -799,7 +799,19 @@ implements StatusListener
|
||||
FileInputStream inputStream = null;
|
||||
try {
|
||||
inputStream = new FileInputStream(infile);
|
||||
setModel(new MazePersistWorldEdit().parseInputStream("we",inputStream));
|
||||
LabyLayers newLayers = new MazePersistWorldEdit().parseInputStream("we",inputStream);
|
||||
if ( ! newLayers.isEmpty()) {
|
||||
int l = layer;
|
||||
for (int i = newLayers.getMin(); i <= newLayers.getMax(); i++) {
|
||||
LabyModel m = newLayers.getLayer(i);
|
||||
if (m != null) {
|
||||
System.out.println("add layer " + l);
|
||||
layers.addLabyModel(l, m);
|
||||
l++;
|
||||
}
|
||||
}
|
||||
setModel(layers.getLayer(layer));
|
||||
}
|
||||
} catch (IOException io) {
|
||||
io.printStackTrace(System.err);
|
||||
statusField.setText("[ERROR] Can't load " + infile.getAbsolutePath());
|
||||
|
||||
Reference in New Issue
Block a user