mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 14:21:33 +00:00
Make hotloading idiot proof
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'com.volmit.iris'
|
group 'com.volmit.iris'
|
||||||
version '1.7.1'
|
version '1.7.2'
|
||||||
def apiVersion = '1.17'
|
def apiVersion = '1.17'
|
||||||
def name = getRootProject().getName() // See settings.gradle
|
def name = getRootProject().getName() // See settings.gradle
|
||||||
def main = 'com.volmit.iris.Iris'
|
def main = 'com.volmit.iris.Iris'
|
||||||
|
|||||||
@@ -112,15 +112,17 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hotload() {
|
public void hotload() {
|
||||||
J.aBukkit(() -> {
|
J.aBukkit(this::hotloadBLOCKING);
|
||||||
try {
|
}
|
||||||
hotloadLock.acquire(HOTLOAD_LOCKS);
|
|
||||||
initialize();
|
public void hotloadBLOCKING() {
|
||||||
hotloadLock.release(HOTLOAD_LOCKS);
|
try {
|
||||||
} catch (InterruptedException e) {
|
hotloadLock.acquire(HOTLOAD_LOCKS);
|
||||||
e.printStackTrace();
|
initialize();
|
||||||
}
|
hotloadLock.release(HOTLOAD_LOCKS);
|
||||||
});
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
@@ -154,6 +156,13 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
return tc.getRaw();
|
return tc.getRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
catch(WrongEngineBroException e)
|
||||||
|
{
|
||||||
|
hotloadLock.release();
|
||||||
|
hotloadBLOCKING();
|
||||||
|
return generateChunkData(world, ignored, x, z, biome);
|
||||||
|
}
|
||||||
|
|
||||||
catch (Throwable e) {
|
catch (Throwable e) {
|
||||||
Iris.error("======================================");
|
Iris.error("======================================");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
Reference in New Issue
Block a user