From a5725439ee928a133e33ebd4e25462f51a60e38b Mon Sep 17 00:00:00 2001 From: Daniel Mills Date: Sun, 6 Dec 2020 06:30:42 -0500 Subject: [PATCH] v+ --- pom.xml | 2 +- .../iris/scaffold/parallax/ParallaxWorld.java | 35 +++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index bd1771338..97bd20b9f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.volmit Iris - 1.1.4 + 1.1.5 Iris false diff --git a/src/main/java/com/volmit/iris/scaffold/parallax/ParallaxWorld.java b/src/main/java/com/volmit/iris/scaffold/parallax/ParallaxWorld.java index e6605925e..2e06abddb 100644 --- a/src/main/java/com/volmit/iris/scaffold/parallax/ParallaxWorld.java +++ b/src/main/java/com/volmit/iris/scaffold/parallax/ParallaxWorld.java @@ -38,7 +38,7 @@ public class ParallaxWorld implements ParallaxAccess { int m = 0; - synchronized (loadedRegions) + try { for(ParallaxRegion i : loadedRegions.values()) { @@ -46,6 +46,11 @@ public class ParallaxWorld implements ParallaxAccess } } + catch(Throwable e) + { + + } + return m; } @@ -201,19 +206,16 @@ public class ParallaxWorld implements ParallaxAccess @Override public void cleanup(long r, long c) { J.a(() -> { - synchronized (loadedRegions) + for(ParallaxRegion i : loadedRegions.v()) { - for(ParallaxRegion i : loadedRegions.v()) + if(i.hasBeenIdleLongerThan(r)) { - if(i.hasBeenIdleLongerThan(r)) - { - unload(i.getX(), i.getZ()); - } + unload(i.getX(), i.getZ()); + } - else - { - i.cleanup(c); - } + else + { + i.cleanup(c); } } }); @@ -226,16 +228,13 @@ public class ParallaxWorld implements ParallaxAccess @Override public synchronized void saveAllNOW() { - synchronized (loadedRegions) + for(ParallaxRegion i : loadedRegions.v()) { - for(ParallaxRegion i : loadedRegions.v()) + synchronized (save) { - synchronized (save) + if(save.contains(key(i.getX(), i.getZ()))) { - if(save.contains(key(i.getX(), i.getZ()))) - { - save(i.getX(), i.getZ()); - } + save(i.getX(), i.getZ()); } } }