[1.7.10] Fix dead lock and NPE when jumping backwards in replays
The deadlock is a regression due to login phase inclusion. Not sure about the NPE, it might have always existed.
This commit is contained in:
@@ -642,6 +642,12 @@ public class ReplayHandler {
|
||||
replaySender.setAsyncMode(true);
|
||||
replaySender.setReplaySpeed(0);
|
||||
|
||||
//#if MC<10800
|
||||
//$$ while (mc.currentScreen instanceof GuiOpeningReplay) {
|
||||
//$$ mc.currentScreen.handleInput();
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
mc.getNetworkHandler().getClientConnection()
|
||||
//#if MC>=11300
|
||||
.tick();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
//#if MC<10800
|
||||
//$$ package com.replaymod.replay.mixin;
|
||||
//$$
|
||||
//$$ import com.replaymod.replay.gui.screen.GuiOpeningReplay;
|
||||
//$$ import cpw.mods.fml.client.FMLClientHandler;
|
||||
//$$ import net.minecraft.client.Minecraft;
|
||||
//$$ import net.minecraft.client.gui.GuiScreen;
|
||||
//$$ import org.spongepowered.asm.mixin.Mixin;
|
||||
//$$ import org.spongepowered.asm.mixin.injection.At;
|
||||
//$$ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
//$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
//$$
|
||||
//$$ @Mixin(value = FMLClientHandler.class, remap = false)
|
||||
//$$ public class MixinFMLClientHandler {
|
||||
//$$ // Usually this method is called async and can just block and wait for MC to tick the network manager
|
||||
//$$ // Since we sometimes call it sync though, we need to take care of ticking ourselves.
|
||||
//$$ @Inject(method = "waitForPlayClient", at = @At("HEAD"), remap = false)
|
||||
//$$ private void tickNetworkManager(CallbackInfo ci) {
|
||||
//$$ Minecraft mc = Minecraft.getMinecraft();
|
||||
//$$ if (!mc.isCallingFromMinecraftThread()) {
|
||||
//$$ return;
|
||||
//$$ }
|
||||
//$$ GuiScreen gui = mc.currentScreen;
|
||||
//$$ if (gui instanceof GuiOpeningReplay) {
|
||||
//$$ gui.handleInput();
|
||||
//$$ }
|
||||
//$$ }
|
||||
//$$ }
|
||||
//#endif
|
||||
Reference in New Issue
Block a user