Fix world being set to null on replay restart when in sync mode
This commit is contained in:
@@ -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.
|
* 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
|
* If this is the case, subsequent calls to runLater have to be delayed until all scheduled tasks have been
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class ReplayHandler {
|
|||||||
channel.close();
|
channel.close();
|
||||||
|
|
||||||
// Force re-creation of camera entity by unloading the previous world
|
// Force re-creation of camera entity by unloading the previous world
|
||||||
ReplayMod.instance.runLater(() -> {
|
ReplayMod.instance.runSync(() -> {
|
||||||
//#if MC>=11300
|
//#if MC>=11300
|
||||||
mc.mouse.unlockCursor();
|
mc.mouse.unlockCursor();
|
||||||
//#else
|
//#else
|
||||||
|
|||||||
Reference in New Issue
Block a user