aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-27 17:11:10 +0200
committermakamys <makamys@outlook.com>2022-06-27 18:30:52 +0200
commit3d0bc63e8bf9d817ccdcb27fdbcde5d995ce9307 (patch)
treeff2ad545b01b74b782be09ec64bbf47b48582aea
parentda152e5a796a0369127ad4fb2b81715a0ec9cbd7 (diff)
downloadNeodymium-3d0bc63e8bf9d817ccdcb27fdbcde5d995ce9307.tar.gz
Neodymium-3d0bc63e8bf9d817ccdcb27fdbcde5d995ce9307.tar.bz2
Neodymium-3d0bc63e8bf9d817ccdcb27fdbcde5d995ce9307.zip
Fix crash when joining a server
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRegion.java4
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java8
2 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRegion.java b/src/main/java/makamys/neodymium/renderer/NeoRegion.java
index 2e4570b..c8ad740 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRegion.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRegion.java
@@ -25,7 +25,7 @@ public class NeoRegion {
}
}
- public static NeoRegion load(Path saveDir, int regionX, int regionZ) {
+ public static NeoRegion load(int regionX, int regionZ) {
return new NeoRegion(regionX, regionZ);
}
@@ -58,7 +58,7 @@ public class NeoRegion {
}
}
- public void destroy(Path saveDir) {
+ public void destroy() {
for(int i = 0; i < 32; i++) {
for(int j = 0; j < 32; j++) {
NeoChunk chunk = data[i][j];
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index c6f72da..413e1a0 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -185,7 +185,7 @@ public class NeoRenderer {
NeoRegion v = kv.getValue();
if(v.shouldDelete()) {
- v.destroy(getSaveDir());
+ v.destroy();
it.remove();
} else {
v.tick();
@@ -488,7 +488,7 @@ public class NeoRenderer {
ChunkCoordIntPair key = new ChunkCoordIntPair(Math.floorDiv(chunkX , 32), Math.floorDiv(chunkZ, 32));
NeoRegion region = loadedRegionsMap.get(key);
if(region == null) {
- region = NeoRegion.load(getSaveDir(), Math.floorDiv(chunkX , 32), Math.floorDiv(chunkZ , 32));
+ region = NeoRegion.load(Math.floorDiv(chunkX , 32), Math.floorDiv(chunkZ , 32));
loadedRegionsMap.put(key, region);
}
return region;
@@ -564,10 +564,6 @@ public class NeoRenderer {
return text;
}
- private Path getSaveDir(){
- return Minecraft.getMinecraft().mcDataDir.toPath().resolve("neodymium").resolve(Minecraft.getMinecraft().getIntegratedServer().getFolderName());
- }
-
private boolean shouldRenderInWorld(World world) {
return world != null;
}