Proper plax coord checking

This commit is contained in:
Daniel Mills 2021-07-20 00:14:39 -04:00
parent 1156b909eb
commit 0ec2f68a96

View File

@ -229,6 +229,8 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
for (j = -s; j <= s; j++) { for (j = -s; j <= s; j++) {
ParallaxChunkMeta m = getParallaxAccess().getMetaR(i + cx, j + cz); ParallaxChunkMeta m = getParallaxAccess().getMetaR(i + cx, j + cz);
synchronized (m)
{
try { try {
for (IrisFeaturePositional k : m.getFeatures()) { for (IrisFeaturePositional k : m.getFeatures()) {
if (k.shouldFilter(x, z)) { if (k.shouldFilter(x, z)) {
@ -236,10 +238,13 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
} }
} }
} catch (Throwable e) { } catch (Throwable e) {
Iris.error("FILTER ERROR" + " AT " + (cx + i) + " " + (j + cz));
e.printStackTrace();
Iris.reportError(e); Iris.reportError(e);
} }
} }
} }
}
getFeatureLock().unlock(); getFeatureLock().unlock();
return pos; return pos;
@ -325,7 +330,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
default KList<Runnable> generateParallaxVacuumLayer(int x, int z) { default KList<Runnable> generateParallaxVacuumLayer(int x, int z) {
KList<Runnable> after = new KList<>(); KList<Runnable> after = new KList<>();
if (getParallaxAccess().isParallaxGenerated(x, z)) { if (getParallaxAccess().isParallaxGenerated(x >> 4, z >> 4)) {
return after; return after;
} }
@ -344,7 +349,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
} }
default void generateParallaxLayer(int x, int z, boolean force) { default void generateParallaxLayer(int x, int z, boolean force) {
if (!force && getParallaxAccess().isParallaxGenerated(x, z)) { if (!force && getParallaxAccess().isParallaxGenerated(x >> 4, z >> 4)) {
return; return;
} }