Dont wait for the mantle to load, skip it until it's loaded (async)

This commit is contained in:
cyberpwn 2021-09-12 10:56:58 -04:00
parent 88aad1e107
commit ce94c5e237
2 changed files with 5 additions and 1 deletions

View File

@ -266,7 +266,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
&& c.getWorld().isChunkLoaded(c.getX(), c.getZ() - 1)
&& c.getWorld().isChunkLoaded(c.getX() - 1, c.getZ())
&& c.getWorld().isChunkLoaded(c.getX() + 1, c.getZ() - 1)
&& c.getWorld().isChunkLoaded(c.getX() - 1, c.getZ() + 1)) {
&& c.getWorld().isChunkLoaded(c.getX() - 1, c.getZ() + 1) && getMantle().getMantle().isLoaded(c)) {
getMantle().getMantle().raiseFlag(c.getX(), c.getZ(), MantleFlag.UPDATE, () -> J.s(() -> {
PrecisionStopwatch p = PrecisionStopwatch.start();
KMap<Long, Integer> updates = new KMap<>();

View File

@ -524,4 +524,8 @@ public class Mantle {
slice.iterateSync((xx, yy, zz, t) -> set(x + xx, y + yy, z + zz, t));
}
public boolean isLoaded(Chunk c) {
return loadedRegions.containsKey(key(c.getX() >> 5, c.getZ() >> 5));
}
}