Fix playback once end has been reached on 1.8 (and some above)
This commit is contained in:
@@ -836,6 +836,10 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
while (paused() && hasWorldLoaded && desiredTimeStamp == -1 && !terminate) {
|
while (paused() && hasWorldLoaded && desiredTimeStamp == -1 && !terminate) {
|
||||||
Thread.sleep(10);
|
Thread.sleep(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (terminate) {
|
||||||
|
break REPLAY_LOOP;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -1119,6 +1123,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
|||||||
IOUtils.readFully(in, bytes);
|
IOUtils.readFully(in, bytes);
|
||||||
} else {
|
} else {
|
||||||
com.replaymod.replaystudio.PacketData data = in.readPacket();
|
com.replaymod.replaystudio.PacketData data = in.readPacket();
|
||||||
|
if (data == null) {
|
||||||
|
throw new EOFException();
|
||||||
|
}
|
||||||
timestamp = (int) data.getTime();
|
timestamp = (int) data.getTime();
|
||||||
// We need to re-encode MCProtocolLib packets, so we can later decode them as NMS packets
|
// We need to re-encode MCProtocolLib packets, so we can later decode them as NMS packets
|
||||||
// The main reason we aren't reading them as NMS packets is that we want ReplayStudio to be able
|
// The main reason we aren't reading them as NMS packets is that we want ReplayStudio to be able
|
||||||
|
|||||||
@@ -175,6 +175,9 @@ public class ReplayHandler {
|
|||||||
//#if MC>=11400
|
//#if MC>=11400
|
||||||
mc.disconnect();
|
mc.disconnect();
|
||||||
//#else
|
//#else
|
||||||
|
//$$ // We need to re-set the GUI screen because having one with `allowsUserInput = true` active during world
|
||||||
|
//$$ // load (i.e. before player is set) will crash MC...
|
||||||
|
//$$ mc.displayGuiScreen(new GuiScreen() {});
|
||||||
//$$ mc.loadWorld(null);
|
//$$ mc.loadWorld(null);
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user