Print a warning instead of an error when a file can not be loaded, but can be regenerated

This commit is contained in:
Blue (Lukas Rieger) 2021-06-09 17:27:33 +02:00
parent e78071115d
commit 5c591f591f
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800
2 changed files with 7 additions and 2 deletions

View File

@ -25,6 +25,7 @@
package de.bluecolored.bluemap.core.map;
import com.flowpowered.math.vector.Vector2i;
import de.bluecolored.bluemap.core.BlueMap;
import de.bluecolored.bluemap.core.logger.Logger;
import de.bluecolored.bluemap.core.map.hires.HiresModel;
import de.bluecolored.bluemap.core.map.hires.HiresModelManager;
@ -69,7 +70,11 @@ public BmMap(String id, String name, World world, Path fileRoot, ResourcePack re
File rstateFile = getRenderStateFile();
if (rstateFile.exists()) {
this.renderState.load(rstateFile);
try {
this.renderState.load(rstateFile);
} catch (IOException ex) {
Logger.global.logWarning("Failed to load render-state for map '" + getId() + "': " + ex);
}
}
this.hiresModelManager = new HiresModelManager(

View File

@ -186,7 +186,7 @@ private LowresModel getModel(UUID world, Vector2i tile) {
model = new CachedModel(BufferGeometry.fromJson(json));
} catch (IllegalArgumentException | IOException ex){
Logger.global.logError("Failed to load lowres model: " + modelFile, ex);
Logger.global.logWarning("Failed to load lowres model '" + modelFile + "': " + ex);
try {
FileUtils.delete(modelFile);