aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/NeoRegion.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-22 06:03:03 +0200
committermakamys <makamys@outlook.com>2022-06-22 06:03:03 +0200
commitd5e4a114ef2e29ea7f00581c34ffcb709ba44064 (patch)
tree872b1e5e5c49e8bc5aafb8cbd66f287f360390ce /src/main/java/makamys/neodymium/renderer/NeoRegion.java
parente44cc6847cc24f7cbfb67a2952b431bc51bf7a1e (diff)
downloadNeodymium-d5e4a114ef2e29ea7f00581c34ffcb709ba44064.tar.gz
Neodymium-d5e4a114ef2e29ea7f00581c34ffcb709ba44064.tar.bz2
Neodymium-d5e4a114ef2e29ea7f00581c34ffcb709ba44064.zip
Unload regions when they are empty, not when they are "far" away
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoRegion.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRegion.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRegion.java b/src/main/java/makamys/neodymium/renderer/NeoRegion.java
index 841bf55..78bf9e7 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRegion.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRegion.java
@@ -174,5 +174,17 @@ public class NeoRegion {
public String toString() {
return "LODRegion(" + regionX + ", " + regionZ + ")";
}
+
+ public boolean isEmpty() {
+ for(int i = 0; i < 32; i++) {
+ for(int j = 0; j < 32; j++) {
+ NeoChunk chunk = data[i][j];
+ if(chunk != null && !chunk.isEmpty()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
}