Fix main thread not actually blocking until JEI thread finishes
This commit is contained in:
parent
bc5b85efcc
commit
a4ce490963
|
|
@ -66,7 +66,10 @@ public class ClientLifecycleHandlerMixin {
|
|||
JEIReloadThread currentReloadThread = reloadThread;
|
||||
if(currentReloadThread != null) {
|
||||
currentReloadThread.requestStop();
|
||||
Minecraft.getInstance().managedBlock(currentReloadThread::isAlive);
|
||||
if(currentReloadThread.isAlive()) {
|
||||
ModernFix.LOGGER.warn("Blocking until JEI thread terminates");
|
||||
Minecraft.getInstance().managedBlock(() -> !currentReloadThread.isAlive());
|
||||
}
|
||||
reloadThread = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -74,7 +77,6 @@ public class ClientLifecycleHandlerMixin {
|
|||
private static int numReloads = 1;
|
||||
|
||||
private void startJEIAsync(Runnable whenFinishedCb) {
|
||||
ModernFix.LOGGER.info("JEI restart triggered. Waiting for previous thread to die.");
|
||||
cancelPreviousStart();
|
||||
ModernFix.LOGGER.info("Starting new JEI thread.");
|
||||
JEIReloadThread newThread = new JEIReloadThread(() -> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user