Fix thread-unsafe mc method call in FullReplaySender (fixes #370)

This commit is contained in:
Jonas Herzig
2020-09-27 15:28:08 +02:00
parent 1382e9fb31
commit a55320030f

View File

@@ -729,10 +729,12 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
final PlayerPositionLookS2CPacket ppl = (PlayerPositionLookS2CPacket) p; final PlayerPositionLookS2CPacket ppl = (PlayerPositionLookS2CPacket) p;
if(!hasWorldLoaded) hasWorldLoaded = true; if(!hasWorldLoaded) hasWorldLoaded = true;
if (mc.currentScreen instanceof DownloadingTerrainScreen) { ReplayMod.instance.runLater(() -> {
// Close the world loading screen manually in case we swallow the packet if (mc.currentScreen instanceof DownloadingTerrainScreen) {
mc.openScreen(null); // Close the world loading screen manually in case we swallow the packet
} mc.openScreen(null);
}
});
if(replayHandler.shouldSuppressCameraMovements()) return null; if(replayHandler.shouldSuppressCameraMovements()) return null;