diff options
author | makamys <makamys@outlook.com> | 2022-06-22 06:03:03 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-22 06:03:03 +0200 |
commit | d5e4a114ef2e29ea7f00581c34ffcb709ba44064 (patch) | |
tree | 872b1e5e5c49e8bc5aafb8cbd66f287f360390ce /src/main/java/makamys/neodymium/renderer/NeoRegion.java | |
parent | e44cc6847cc24f7cbfb67a2952b431bc51bf7a1e (diff) | |
download | Neodymium-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.java | 12 |
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; + } } |