Skip to content

Commit 0ffd46c

Browse files
committed
Merge branch 'mc/1.13' into mc/1.12
2 parents 533d5e8 + de8031e commit 0ffd46c

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

BlueMapBukkit/src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: BlueMap
22
description: "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)"
33
main: de.bluecolored.bluemap.bukkit.BukkitPlugin
4-
version: "0.5.0-mc1.12"
4+
version: "0.5.1-mc1.12"
55
author: "Blue (TBlueF / Lukas Rieger)"
66
authors: [Blue (TBlueF / Lukas Rieger)]
77
website: "https://github.com/BlueMap-Minecraft"

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ public void addRenderTask(RenderTask task) {
6666
}
6767

6868
public RenderTicket createTicket(MapType mapType, Vector2i tile) {
69-
RenderTicket ticket = new RenderTicket(mapType, tile);
69+
return createTicket(new RenderTicket(mapType, tile));
70+
}
71+
72+
private RenderTicket createTicket(RenderTicket ticket) {
7073
synchronized (renderTickets) {
7174
if (renderTicketMap.putIfAbsent(ticket, ticket) == null) {
7275
renderTickets.add(ticket);
@@ -138,7 +141,12 @@ private void renderThread() {
138141
try {
139142
ticket.render();
140143
} catch (IOException e) {
141-
Logger.global.logError("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "'!", e);
144+
if (ticket.getRenderAttempts() < 3) {
145+
Logger.global.logDebug("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "', rescheduling for " + (ticket.getRenderAttempts() + 1) + ". attempt..");
146+
createTicket(ticket); //this might be a temporary issue, so we reschedule ticket for another attempt
147+
} else {
148+
Logger.global.logError("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "'!", e);
149+
}
142150
}
143151
} else {
144152
try {

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTicket.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ public class RenderTicket {
1010
private final MapType map;
1111
private final Vector2i tile;
1212

13+
private int renderAttempts;
1314
private boolean finished;
1415

1516
public RenderTicket(MapType map, Vector2i tile) {
1617
this.map = map;
1718
this.tile = tile;
19+
20+
this.renderAttempts = 0;
1821
this.finished = false;
1922
}
2023

2124
public synchronized void render() throws IOException {
25+
renderAttempts++;
26+
2227
if (!finished) {
2328
map.renderTile(tile);
2429

@@ -34,6 +39,10 @@ public Vector2i getTile() {
3439
return tile;
3540
}
3641

42+
public int getRenderAttempts() {
43+
return renderAttempts;
44+
}
45+
3746
public boolean isFinished() {
3847
return finished;
3948
}

BlueMapCommon/src/main/resources/mcmod.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"modid": "bluemap",
44
"name": "BlueMap",
5-
"version": "0.5.0-mc1.12",
5+
"version": "0.5.1-mc1.12",
66
"description": "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)",
77
"url": "https://github.com/BlueMap-Minecraft",
88
"authorList": [

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/BlueMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
public class BlueMap {
44

5-
public static final String VERSION = "0.5.0-mc1.12";
5+
public static final String VERSION = "0.5.1-mc1.12";
66

77
}

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/MCAWorld.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public Chunk getChunk(Vector2i chunkPos) throws IOException {
217217
private Chunk loadChunk(Vector2i chunkPos) throws IOException {
218218
Vector2i regionPos = chunkToRegion(chunkPos);
219219
Path regionPath = getMCAFilePath(regionPos);
220-
220+
221221
try (RandomAccessFile raf = new RandomAccessFile(regionPath.toFile(), "r")) {
222222

223223
int xzChunk = Math.floorMod(chunkPos.getY(), 32) * 32 + Math.floorMod(chunkPos.getX(), 32);
@@ -248,9 +248,6 @@ private Chunk loadChunk(Vector2i chunkPos) throws IOException {
248248
} else {
249249
throw new IOException("invalid data tag: " + (tag == null ? "null" : tag.getClass().getName()));
250250
}
251-
252-
} catch (FileNotFoundException ex) {
253-
return Chunk.empty(this, chunkPos);
254251
}
255252
}
256253

0 commit comments

Comments
 (0)