diff --git a/README.md b/README.md index 9a628ca..1821849 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ The maps can be configured by adding options to the map's section in the `world. | `chunkyCpuLoad` | Percentage of CPU time to use, per Chunky thread. Note that this only throttles the CPU usage during rendering, not during scene loading or post processing. | 100 | | `texturepack` | Texturepack path, relative to `plugins/dynmap`. Use this option to specify a texturepack for a map. The texturepack in Dynmap's `configuration.txt` is ignored by ChunkyMap. | _None_ | | `chunkPadding` | Radius of additional chunks to be loaded around each chunk that is required to render a tile of the map. This can be used to reduce artifacts caused by shadows and reflections. | 0 | +| `requeueFailedTiles` | Put tiles that failed to render back into the tile queue. | true | | `templateScene` | Path to a Chunky scene file (JSON), relative to `plugins/dynmap`. Use this option to customize the scene that is used for rendering the tiles, e.g. to change the water color. | _None_ | | `texturepackVersion` | The Minecraft version that should be used as fallback textures | 1.16.2 | | `denoiser.enabled` | Enable denoising using [Intel Open Image Denoise](https://openimagedenoise.github.io/). Only works on Linux | false | diff --git a/src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMap.java b/src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMap.java index b223a73..dfcc6a8 100644 --- a/src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMap.java +++ b/src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMap.java @@ -44,7 +44,8 @@ public class ChunkyMap extends HDMap { private File defaultTexturepackPath; private File texturepackPath; private JsonObject templateScene; - private int chunkPadding; + private final int chunkPadding; + private final boolean requeueFailedTiles; public ChunkyMap(DynmapCore dynmap, ConfigurationNode config) { super(dynmap, config); @@ -69,6 +70,7 @@ public ChunkyMap(DynmapCore dynmap, ConfigurationNode config) { ); } chunkPadding = config.getInteger("chunkPadding", 0); + requeueFailedTiles = config.getBoolean("requeueFailedTiles", true); String texturepackVersion = config.getString("texturepackVersion", DEFAULT_TEXTUREPACK_VERSION); File texturepackPath = new File( @@ -196,6 +198,10 @@ int getChunkPadding() { return chunkPadding; } + public boolean getRequeueFailedTiles() { + return requeueFailedTiles; + } + void applyTemplateScene(Scene scene) { if (this.templateScene != null) { scene.importFromJson(templateScene); diff --git a/src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMapTile.java b/src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMapTile.java index 8fc2794..dea31b2 100644 --- a/src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMapTile.java +++ b/src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMapTile.java @@ -153,6 +153,12 @@ public boolean render(MapChunkCache mapChunkCache, String s) { } catch (Exception e) { ChunkyMapPlugin.getPlugin(ChunkyMapPlugin.class).getLogger() .log(Level.WARNING, "Rendering tile failed", e); + + if (map.getRequeueFailedTiles()) { + // Re-queue the failed tile + // Somewhat hacky but works surprisingly well + MapManager.mapman.tileQueue.push(this); + } return false; } finally { context.dispose();