Merge branch 'mc/1.13'

This commit is contained in:
Blue (Lukas Rieger) 2020-03-29 11:49:03 +02:00
commit 5f7517a9d6
6 changed files with 23 additions and 9 deletions

View File

@ -1,7 +1,7 @@
name: BlueMap
description: "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)"
main: de.bluecolored.bluemap.bukkit.BukkitPlugin
version: 0.5.0
version: 0.5.1
author: "Blue (TBlueF / Lukas Rieger)"
authors: [Blue (TBlueF / Lukas Rieger)]
website: "https://github.com/BlueMap-Minecraft"

View File

@ -66,7 +66,10 @@ public class RenderManager {
}
public RenderTicket createTicket(MapType mapType, Vector2i tile) {
RenderTicket ticket = new RenderTicket(mapType, tile);
return createTicket(new RenderTicket(mapType, tile));
}
private RenderTicket createTicket(RenderTicket ticket) {
synchronized (renderTickets) {
if (renderTicketMap.putIfAbsent(ticket, ticket) == null) {
renderTickets.add(ticket);
@ -138,7 +141,12 @@ public class RenderManager {
try {
ticket.render();
} catch (IOException e) {
Logger.global.logError("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "'!", e);
if (ticket.getRenderAttempts() < 3) {
Logger.global.logDebug("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "', rescheduling for " + (ticket.getRenderAttempts() + 1) + ". attempt..");
createTicket(ticket); //this might be a temporary issue, so we reschedule ticket for another attempt
} else {
Logger.global.logError("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "'!", e);
}
}
} else {
try {

View File

@ -10,15 +10,20 @@ public class RenderTicket {
private final MapType map;
private final Vector2i tile;
private int renderAttempts;
private boolean finished;
public RenderTicket(MapType map, Vector2i tile) {
this.map = map;
this.tile = tile;
this.renderAttempts = 0;
this.finished = false;
}
public synchronized void render() throws IOException {
renderAttempts++;
if (!finished) {
map.renderTile(tile);
@ -34,6 +39,10 @@ public class RenderTicket {
return tile;
}
public int getRenderAttempts() {
return renderAttempts;
}
public boolean isFinished() {
return finished;
}

View File

@ -2,7 +2,7 @@
{
"modid": "bluemap",
"name": "BlueMap",
"version": "0.5.0",
"version": "0.5.1",
"description": "A 3d-map of your Minecraft worlds view-able in your browser using three.js (WebGL)",
"url": "https://github.com/BlueMap-Minecraft",
"authorList": [

View File

@ -2,6 +2,6 @@ package de.bluecolored.bluemap.core;
public class BlueMap {
public static final String VERSION = "0.5.0";
public static final String VERSION = "0.5.1";
}

View File

@ -217,7 +217,7 @@ public class MCAWorld implements World {
private Chunk loadChunk(Vector2i chunkPos) throws IOException {
Vector2i regionPos = chunkToRegion(chunkPos);
Path regionPath = getMCAFilePath(regionPos);
try (RandomAccessFile raf = new RandomAccessFile(regionPath.toFile(), "r")) {
int xzChunk = Math.floorMod(chunkPos.getY(), 32) * 32 + Math.floorMod(chunkPos.getX(), 32);
@ -248,9 +248,6 @@ public class MCAWorld implements World {
} else {
throw new IOException("invalid data tag: " + (tag == null ? "null" : tag.getClass().getName()));
}
} catch (FileNotFoundException ex) {
return Chunk.empty(this, chunkPos);
}
}