diff options
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoRenderer.java')
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/NeoRenderer.java | 7 |
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; |