Fix world being set to null on replay restart when in sync mode

This commit is contained in:
Jonas Herzig
2019-05-21 11:04:38 +02:00
parent 8627867b62
commit cc9f2828c1
2 changed files with 13 additions and 1 deletions

View File

@@ -378,6 +378,18 @@ public class ReplayMod implements
});
}
public void runSync(Runnable runnable) {
//#if MC>=11400
if (mc.isOnThread()) {
//#else
//$$ if (mc.isCallingFromMinecraftThread()) {
//#endif
runnable.run();
} else {
runLater(runnable);
}
}
/**
* Set when the currently running code has been scheduled by runLater.
* If this is the case, subsequent calls to runLater have to be delayed until all scheduled tasks have been

View File

@@ -162,7 +162,7 @@ public class ReplayHandler {
channel.close();
// Force re-creation of camera entity by unloading the previous world
ReplayMod.instance.runLater(() -> {
ReplayMod.instance.runSync(() -> {
//#if MC>=11300
mc.mouse.unlockCursor();
//#else