From 5c591f591f567e3124237609f5e29bb46aa1072f Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Wed, 9 Jun 2021 17:27:33 +0200 Subject: [PATCH] Print a warning instead of an error when a file can not be loaded, but can be regenerated --- .../main/java/de/bluecolored/bluemap/core/map/BmMap.java | 7 ++++++- .../bluemap/core/map/lowres/LowresModelManager.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/BmMap.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/BmMap.java index 49c15b83..2223560a 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/BmMap.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/BmMap.java @@ -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( diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresModelManager.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresModelManager.java index b7e4762d..7cc3f154 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresModelManager.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresModelManager.java @@ -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);