This commit is contained in:
cyberpwn 2021-08-31 17:14:11 -04:00
parent 6b4bd90bfa
commit b5d7e2969f
3 changed files with 12 additions and 2 deletions

View File

@ -69,6 +69,7 @@ public class AsyncPregenMethod implements PregeneratorMethod {
PaperLib.getChunkAtAsync(world, x, z, true).get(); PaperLib.getChunkAtAsync(world, x, z, true).get();
listener.onChunkGenerated(x, z); listener.onChunkGenerated(x, z);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace();
J.sleep(5); J.sleep(5);
future.add(burst.complete(() -> completeChunk(x, z, listener))); future.add(burst.complete(() -> completeChunk(x, z, listener)));
} }

View File

@ -46,10 +46,11 @@ public class IrisEngineEffects extends EngineAssignedComponent implements Engine
public void updatePlayerMap() { public void updatePlayerMap() {
List<Player> pr = getEngine().getWorld().getPlayers(); List<Player> pr = getEngine().getWorld().getPlayers();
if (pr == null) return; //Fix for paper returning a world with a null playerlist if (pr == null) {
return;
}
for (Player i : pr) { for (Player i : pr) {
Location l = i.getLocation();
boolean pcc = players.containsKey(i.getUniqueId()); boolean pcc = players.containsKey(i.getUniqueId());
if (!pcc) { if (!pcc) {
players.put(i.getUniqueId(), new EnginePlayer(getEngine(), i)); players.put(i.getUniqueId(), new EnginePlayer(getEngine(), i));

View File

@ -67,6 +67,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
private double energy = 25; private double energy = 25;
private int entityCount = 0; private int entityCount = 0;
private final ChronoLatch cl; private final ChronoLatch cl;
private final ChronoLatch clw;
private final ChronoLatch ecl; private final ChronoLatch ecl;
private final ChronoLatch cln; private final ChronoLatch cln;
private final ChronoLatch chunkUpdater; private final ChronoLatch chunkUpdater;
@ -80,6 +81,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
cl = null; cl = null;
ecl = null; ecl = null;
cln = null; cln = null;
clw = null;
chunkCooldowns = null; chunkCooldowns = null;
looper = null; looper = null;
chunkUpdater = null; chunkUpdater = null;
@ -92,6 +94,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
cln = new ChronoLatch(60000); cln = new ChronoLatch(60000);
cl = new ChronoLatch(3000); cl = new ChronoLatch(3000);
ecl = new ChronoLatch(250); ecl = new ChronoLatch(250);
clw = new ChronoLatch(1000, true);
chunkCooldowns = new KMap<>(); chunkCooldowns = new KMap<>();
id = engine.getCacheID(); id = engine.getCacheID();
energy = 25; energy = 25;
@ -102,6 +105,11 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
interrupt(); interrupt();
} }
if(!getEngine().getWorld().hasRealWorld() && clw.flip())
{
getEngine().getWorld().tryGetRealWorld();
}
if (getEngine().getWorld().hasRealWorld()) { if (getEngine().getWorld().hasRealWorld()) {
if (chunkUpdater.flip()) { if (chunkUpdater.flip()) {
updateChunks(); updateChunks();