mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-27 19:19:07 +00:00
Make hotloading idiot proof
This commit is contained in:
@@ -112,15 +112,17 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
|
||||
@Override
|
||||
public void hotload() {
|
||||
J.aBukkit(() -> {
|
||||
try {
|
||||
hotloadLock.acquire(HOTLOAD_LOCKS);
|
||||
initialize();
|
||||
hotloadLock.release(HOTLOAD_LOCKS);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
J.aBukkit(this::hotloadBLOCKING);
|
||||
}
|
||||
|
||||
public void hotloadBLOCKING() {
|
||||
try {
|
||||
hotloadLock.acquire(HOTLOAD_LOCKS);
|
||||
initialize();
|
||||
hotloadLock.release(HOTLOAD_LOCKS);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
@@ -154,6 +156,13 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
return tc.getRaw();
|
||||
}
|
||||
|
||||
catch(WrongEngineBroException e)
|
||||
{
|
||||
hotloadLock.release();
|
||||
hotloadBLOCKING();
|
||||
return generateChunkData(world, ignored, x, z, biome);
|
||||
}
|
||||
|
||||
catch (Throwable e) {
|
||||
Iris.error("======================================");
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user