Fix playback once end has been reached on 1.8 (and some above)

This commit is contained in:
Jonas Herzig
2019-08-04 15:06:27 +02:00
parent 94d6e7cb4b
commit c7b0780111
2 changed files with 10 additions and 0 deletions

View File

@@ -836,6 +836,10 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
while (paused() && hasWorldLoaded && desiredTimeStamp == -1 && !terminate) {
Thread.sleep(10);
}
if (terminate) {
break REPLAY_LOOP;
}
break;
} catch (IOException e) {
e.printStackTrace();
@@ -1119,6 +1123,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
IOUtils.readFully(in, bytes);
} else {
com.replaymod.replaystudio.PacketData data = in.readPacket();
if (data == null) {
throw new EOFException();
}
timestamp = (int) data.getTime();
// 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