File tree Expand file tree Collapse file tree 6 files changed +23
-9
lines changed
BlueMapBukkit/src/main/resources
java/de/bluecolored/bluemap/common
BlueMapCore/src/main/java/de/bluecolored/bluemap/core Expand file tree Collapse file tree 6 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 11name : BlueMap
22description : " A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)"
33main : de.bluecolored.bluemap.bukkit.BukkitPlugin
4- version : " 0.5.0 -mc1.12"
4+ version : " 0.5.1 -mc1.12"
55author : " Blue (TBlueF / Lukas Rieger)"
66authors : [Blue (TBlueF / Lukas Rieger)]
77website : " https://github.com/BlueMap-Minecraft"
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 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" : [
Original file line number Diff line number Diff line change 22
33public 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments