Skip to content

Commit 0febfef

Browse files
committed
Put failed tiles back into the tile queue by default.
1 parent 7327d61 commit 0febfef

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ The maps can be configured by adding options to the map's section in the `world.
3939
| `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 |
4040
| `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_ |
4141
| `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 |
42+
| `requeueFailedTiles` | Put tiles that failed to render back into the tile queue. | true |
4243
| `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_ |
4344
| `texturepackVersion` | The Minecraft version that should be used as fallback textures | 1.16.2 |
4445
| `denoiser.enabled` | Enable denoising using [Intel Open Image Denoise](https://openimagedenoise.github.io/). Only works on Linux | false |

src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMap.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public class ChunkyMap extends HDMap {
4444
private File defaultTexturepackPath;
4545
private File texturepackPath;
4646
private JsonObject templateScene;
47-
private int chunkPadding;
47+
private final int chunkPadding;
48+
private final boolean requeueFailedTiles;
4849

4950
public ChunkyMap(DynmapCore dynmap, ConfigurationNode config) {
5051
super(dynmap, config);
@@ -69,6 +70,7 @@ public ChunkyMap(DynmapCore dynmap, ConfigurationNode config) {
6970
);
7071
}
7172
chunkPadding = config.getInteger("chunkPadding", 0);
73+
requeueFailedTiles = config.getBoolean("requeueFailedTiles", true);
7274

7375
String texturepackVersion = config.getString("texturepackVersion", DEFAULT_TEXTUREPACK_VERSION);
7476
File texturepackPath = new File(
@@ -196,6 +198,10 @@ int getChunkPadding() {
196198
return chunkPadding;
197199
}
198200

201+
public boolean getRequeueFailedTiles() {
202+
return requeueFailedTiles;
203+
}
204+
199205
void applyTemplateScene(Scene scene) {
200206
if (this.templateScene != null) {
201207
scene.importFromJson(templateScene);

src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMapTile.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ public boolean render(MapChunkCache mapChunkCache, String s) {
153153
} catch (Exception e) {
154154
ChunkyMapPlugin.getPlugin(ChunkyMapPlugin.class).getLogger()
155155
.log(Level.WARNING, "Rendering tile failed", e);
156+
157+
if (map.getRequeueFailedTiles()) {
158+
// Re-queue the failed tile
159+
// Somewhat hacky but works surprisingly well
160+
MapManager.mapman.tileQueue.push(this);
161+
}
156162
return false;
157163
} finally {
158164
context.dispose();

0 commit comments

Comments
 (0)