From 3a1f78a32af4aeb2e9b69375a2f8c8286cd8767f Mon Sep 17 00:00:00 2001 From: Tom Martin Date: Wed, 18 Sep 2024 10:09:24 +0100 Subject: [PATCH] Fix negative scene minY inconsistent behaviour (#1765) --- chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java b/chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java index a9f59a684..54a69d051 100644 --- a/chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java +++ b/chunky/src/java/se/llbit/chunky/renderer/scene/Scene.java @@ -938,7 +938,7 @@ public synchronized void loadChunks(TaskTracker taskTracker, World world, Collec entities.loadEntitiesInChunk(this, chunkData); - int yCubeMin = yMin / 16; + int yCubeMin = Math.floorDiv(yMin, 16); // round towards -infinity int yCubeMax = (yMax+15) / 16; for(int yCube = yCubeMin; yCube < yCubeMax; ++yCube) { // Reset the cubes