Skip to content

Commit

Permalink
Put failed tiles back into the tile queue by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Dec 17, 2020
1 parent 7327d61 commit 0febfef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(
Expand Down Expand Up @@ -196,6 +198,10 @@ int getChunkPadding() {
return chunkPadding;
}

public boolean getRequeueFailedTiles() {
return requeueFailedTiles;
}

void applyTemplateScene(Scene scene) {
if (this.templateScene != null) {
scene.importFromJson(templateScene);
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/de/lemaik/chunkymap/dynmap/ChunkyMapTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0febfef

Please sign in to comment.