aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2023-12-02 17:16:45 +0100
committermakamys <makamys@outlook.com>2023-12-03 00:38:41 +0100
commitd55ebcaf1ae6545650d925c4d6c95f8b67e8695d (patch)
tree1a92e6262ffa912bd23840949a7437b2745223c7 /src/main/java/makamys/neodymium/renderer/NeoRenderer.java
parent69afa99a2cd190310f13ae6d1737325533951aa3 (diff)
downloadNeodymium-d55ebcaf1ae6545650d925c4d6c95f8b67e8695d.tar.gz
Neodymium-d55ebcaf1ae6545650d925c4d6c95f8b67e8695d.tar.bz2
Neodymium-d55ebcaf1ae6545650d925c4d6c95f8b67e8695d.zip
Move NeoRegion size to a constant
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoRenderer.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index 9b33b91..3ded5da 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -566,10 +566,13 @@ public class NeoRenderer {
}
private NeoRegion getRegionContaining(int chunkX, int chunkZ) {
- ChunkCoordIntPair key = new ChunkCoordIntPair(Math.floorDiv(chunkX , 32), Math.floorDiv(chunkZ, 32));
+ int regionX = Math.floorDiv(chunkX, NeoRegion.SIZE);
+ int regionZ = Math.floorDiv(chunkZ, NeoRegion.SIZE);
+ ChunkCoordIntPair key = new ChunkCoordIntPair(regionX, regionZ);
+
NeoRegion region = loadedRegionsMap.get(key);
if(region == null) {
- region = NeoRegion.load(Math.floorDiv(chunkX , 32), Math.floorDiv(chunkZ , 32));
+ region = NeoRegion.load(regionX, regionZ);
loadedRegionsMap.put(key, region);
}
return region;