diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java index f5fb2048..79275f71 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java @@ -141,11 +141,10 @@ private void renderThread() { try { ticket.render(); } catch (IOException e) { - if (ticket.getRenderAttempts() < 3) { - Logger.global.logDebug("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "', rescheduling for " + (ticket.getRenderAttempts() + 1) + ". attempt.."); - createTicket(ticket); //this might be a temporary issue, so we reschedule ticket for another attempt + if (ticket.getRenderAttempts() <= 1) { + createTicket(ticket); } else { - Logger.global.logError("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "'!", e); + Logger.global.logDebug("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "' after " + ticket.getRenderAttempts() + " render-attempts! (" + e.toString() + ")"); } } } else { diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/MapUpdateHandler.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/MapUpdateHandler.java index 8e485732..2b3e1335 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/MapUpdateHandler.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/MapUpdateHandler.java @@ -21,20 +21,27 @@ public MapUpdateHandler() { } @Override - public void onWorldSaveToDisk(UUID world) { + public void onWorldSaveToDisk(final UUID world) { RenderManager renderManager = Plugin.getInstance().getRenderManager(); - synchronized (updateBuffer) { - Iterator iterator = updateBuffer.keys().iterator(); - while (iterator.hasNext()) { - MapType map = iterator.next(); - if (map.getWorld().getUUID().equals(world)) { - renderManager.createTickets(map, updateBuffer.get(map)); - iterator.remove(); + new Thread(() -> { + try { + Thread.sleep(5000); // wait 5 sec before rendering so saving has finished to avoid render-errors + + synchronized (updateBuffer) { + Iterator iterator = updateBuffer.keys().iterator(); + while (iterator.hasNext()) { + MapType map = iterator.next(); + if (map.getWorld().getUUID().equals(world)) { + renderManager.createTickets(map, updateBuffer.get(map)); + iterator.remove(); + } + } + } - } + } catch (InterruptedException ignore) {} - } + }).start(); } @Override