From fafc5c4a47f517bb0941a5bbd1df2b499927dace Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Fri, 15 Nov 2019 20:18:17 +0100 Subject: [PATCH] Fix render-sorting so it works like intended --- .../de/bluecolored/bluemap/cli/RenderManager.java | 13 +++++++++---- .../de/bluecolored/bluemap/sponge/RenderTask.java | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/BlueMapCLI/src/main/java/de/bluecolored/bluemap/cli/RenderManager.java b/BlueMapCLI/src/main/java/de/bluecolored/bluemap/cli/RenderManager.java index 83477dfa..78f07dc2 100644 --- a/BlueMapCLI/src/main/java/de/bluecolored/bluemap/cli/RenderManager.java +++ b/BlueMapCLI/src/main/java/de/bluecolored/bluemap/cli/RenderManager.java @@ -73,12 +73,17 @@ public RenderManager(World world, TileRenderer tileRenderer, Collection v2Dist) return 1; + + if (v1SortGridPos.getY() < v2SortGridPos.getY()) return -1; + if (v1SortGridPos.getY() > v2SortGridPos.getY()) return 1; + if (v1SortGridPos.getX() < v2SortGridPos.getX()) return -1; + if (v1SortGridPos.getX() > v2SortGridPos.getX()) return 1; } - if (v1.getY() < v1.getY()) return -1; - if (v1.getY() > v1.getY()) return 1; - if (v1.getX() < v1.getX()) return -1; - if (v1.getX() > v1.getX()) return 1; + if (v1.getY() < v2.getY()) return -1; + if (v1.getY() > v2.getY()) return 1; + if (v1.getX() < v2.getX()) return -1; + if (v1.getX() > v2.getX()) return 1; return 0; }); diff --git a/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/RenderTask.java b/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/RenderTask.java index 2d6c573c..c13fb053 100644 --- a/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/RenderTask.java +++ b/BlueMapSponge/src/main/java/de/bluecolored/bluemap/sponge/RenderTask.java @@ -52,12 +52,17 @@ public void optimizeQueue() { if (v1Dist < v2Dist) return -1; if (v1Dist > v2Dist) return 1; + + if (v1SortGridPos.getY() < v2SortGridPos.getY()) return -1; + if (v1SortGridPos.getY() > v2SortGridPos.getY()) return 1; + if (v1SortGridPos.getX() < v2SortGridPos.getX()) return -1; + if (v1SortGridPos.getX() > v2SortGridPos.getX()) return 1; } - if (v1.getY() < v1.getY()) return -1; - if (v1.getY() > v1.getY()) return 1; - if (v1.getX() < v1.getX()) return -1; - if (v1.getX() > v1.getX()) return 1; + if (v1.getY() < v2.getY()) return -1; + if (v1.getY() > v2.getY()) return 1; + if (v1.getX() < v2.getX()) return -1; + if (v1.getX() > v2.getX()) return 1; return 0; });