diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/MapType.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/MapType.java index 5d3a11d3..687fa720 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/MapType.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/MapType.java @@ -24,8 +24,6 @@ */ package de.bluecolored.bluemap.common; -import java.io.IOException; - import com.flowpowered.math.vector.Vector2i; import com.google.common.base.Preconditions; @@ -68,7 +66,7 @@ public TileRenderer getTileRenderer() { return tileRenderer; } - public void renderTile(Vector2i tile) throws IOException { + public void renderTile(Vector2i tile) { getTileRenderer().render(new WorldTile(getWorld(), tile)); } diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java index 131a3d04..087a69a8 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderManager.java @@ -161,11 +161,7 @@ private void renderThread() { } if (ticket != null) { - try { - ticket.render(); - } catch (IOException e) { - Logger.global.logDebug("Failed to render tile " + ticket.getTile() + " of map '" + ticket.getMapType().getId() + "' after " + ticket.getRenderAttempts() + " render-attempts! (" + e.toString() + ")"); - } + ticket.render(); } else { try { Thread.sleep(1000); // we don't need a super fast response time, so waiting a second is totally fine diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTicket.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTicket.java index 5c36f6fa..69842450 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTicket.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/RenderTicket.java @@ -24,7 +24,6 @@ */ package de.bluecolored.bluemap.common; -import java.io.IOException; import java.util.Objects; import com.flowpowered.math.vector.Vector2i; @@ -34,25 +33,13 @@ public class RenderTicket { private final MapType map; private final Vector2i tile; - private int renderAttempts; - private boolean successfullyRendered; - public RenderTicket(MapType map, Vector2i tile) { this.map = map; this.tile = tile; - - this.renderAttempts = 0; - this.successfullyRendered = false; } - public synchronized void render() throws IOException { - renderAttempts++; - - if (!successfullyRendered) { - map.renderTile(tile); - - successfullyRendered = true; - } + public synchronized void render() { + map.renderTile(tile); } public MapType getMapType() { @@ -63,10 +50,6 @@ public Vector2i getTile() { return tile; } - public int getRenderAttempts() { - return renderAttempts; - } - @Override public int hashCode() { return Objects.hash(map.getId(), tile); diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java index b0967916..6f46e113 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java @@ -350,14 +350,10 @@ public int debugCommand(CommandContext context) throws CommandSyntaxException String blockBelowIdMeta = ""; if (world instanceof MCAWorld) { - try { - Chunk chunk = ((MCAWorld) world).getChunk(MCAWorld.blockToChunk(blockPos)); - if (chunk instanceof ChunkAnvil112) { - blockIdMeta = " (" + ((ChunkAnvil112) chunk).getBlockIdMeta(blockPos) + ")"; - blockBelowIdMeta = " (" + ((ChunkAnvil112) chunk).getBlockIdMeta(blockPos.add(0, -1, 0)) + ")"; - } - } catch (IOException ex) { - Logger.global.logError("Failed to read chunk for debug!", ex); + Chunk chunk = ((MCAWorld) world).getChunk(MCAWorld.blockToChunk(blockPos)); + if (chunk instanceof ChunkAnvil112) { + blockIdMeta = " (" + ((ChunkAnvil112) chunk).getBlockIdMeta(blockPos) + ")"; + blockBelowIdMeta = " (" + ((ChunkAnvil112) chunk).getBlockIdMeta(blockPos.add(0, -1, 0)) + ")"; } } diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/MCAWorld.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/MCAWorld.java index e7493d3c..e2251f21 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/MCAWorld.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/MCAWorld.java @@ -268,7 +268,7 @@ private Chunk loadChunk(Vector2i chunkPos) throws IOException { } @Override - public boolean isChunkGenerated(Vector2i chunkPos) throws IOException { + public boolean isChunkGenerated(Vector2i chunkPos) { Chunk chunk = getChunk(chunkPos); return chunk.isGenerated(); } diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/render/TileRenderer.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/render/TileRenderer.java index c65d03e7..4e876042 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/render/TileRenderer.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/render/TileRenderer.java @@ -24,8 +24,6 @@ */ package de.bluecolored.bluemap.core.render; -import java.io.IOException; - import de.bluecolored.bluemap.core.render.hires.HiresModel; import de.bluecolored.bluemap.core.render.hires.HiresModelManager; import de.bluecolored.bluemap.core.render.lowres.LowresModelManager; @@ -42,9 +40,8 @@ public TileRenderer(HiresModelManager hiresModelManager, LowresModelManager lowr /** * Renders the provided WorldTile (only) if the world is generated - * @throws IOException If an IO-Exception occurs during the render */ - public void render(WorldTile tile) throws IOException { + public void render(WorldTile tile) { //check if the region is generated before rendering, don't render if it's not generated AABB area = hiresModelManager.getTileRegion(tile); if (!tile.getWorld().isAreaGenerated(area)) return; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/SlicedWorld.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/SlicedWorld.java index 36e69c7e..3da22abb 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/SlicedWorld.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/SlicedWorld.java @@ -24,7 +24,6 @@ */ package de.bluecolored.bluemap.core.world; -import java.io.IOException; import java.nio.file.Path; import java.util.Collection; import java.util.UUID; @@ -114,24 +113,24 @@ public Collection getChunkList(long modifiedSince, Predicate } @Override - public boolean isChunkGenerated(Vector2i chunkPos) throws IOException { + public boolean isChunkGenerated(Vector2i chunkPos) { if (!isInside(chunkPos)) return false; return world.isChunkGenerated(chunkPos); } @Override - public boolean isAreaGenerated(AABB area) throws IOException { + public boolean isAreaGenerated(AABB area) { return isAreaGenerated(area.getMin(), area.getMax()); } @Override - public boolean isAreaGenerated(Vector3i blockMin, Vector3i blockMax) throws IOException { + public boolean isAreaGenerated(Vector3i blockMin, Vector3i blockMax) { return isAreaGenerated(blockPosToChunkPos(blockMin), blockPosToChunkPos(blockMax)); } @Override - public boolean isAreaGenerated(Vector2i chunkMin, Vector2i chunkMax) throws IOException { + public boolean isAreaGenerated(Vector2i chunkMin, Vector2i chunkMax) { if (!isInside(chunkMin) && !isInside(chunkMax) && !isInside(new Vector2i(chunkMin.getX(), chunkMax.getY())) && diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/World.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/World.java index fbb96862..443b1b73 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/World.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/World.java @@ -110,7 +110,7 @@ public default Collection getChunkList(long modifiedSince){ /** * Returns true if and only if that chunk is fully generated and no world-generation or lighting has yet to be done. */ - public boolean isChunkGenerated(Vector2i chunkPos) throws IOException; + public boolean isChunkGenerated(Vector2i chunkPos); /** @@ -118,7 +118,7 @@ public default Collection getChunkList(long modifiedSince){ * @param area The area to check * @throws IOException */ - public default boolean isAreaGenerated(AABB area) throws IOException { + public default boolean isAreaGenerated(AABB area) { return isAreaGenerated(area.getMin(), area.getMax()); } @@ -127,7 +127,7 @@ public default boolean isAreaGenerated(AABB area) throws IOException { * @param area The area to check * @throws IOException */ - public default boolean isAreaGenerated(Vector3i blockMin, Vector3i blockMax) throws IOException { + public default boolean isAreaGenerated(Vector3i blockMin, Vector3i blockMax) { return isAreaGenerated(blockPosToChunkPos(blockMin), blockPosToChunkPos(blockMax)); } @@ -136,7 +136,7 @@ public default boolean isAreaGenerated(Vector3i blockMin, Vector3i blockMax) thr * @param area The area to check * @throws IOException */ - public default boolean isAreaGenerated(Vector2i chunkMin, Vector2i chunkMax) throws IOException { + public default boolean isAreaGenerated(Vector2i chunkMin, Vector2i chunkMax) { for (int x = chunkMin.getX(); x <= chunkMax.getX(); x++) { for (int z = chunkMin.getY(); z <= chunkMax.getY(); z++) { if (!isChunkGenerated(new Vector2i(x, z))) return false;