Don't rewind when replay is at start tick

This commit is contained in:
Moulberry committed 2025-02-11 17:15:43 +08:00
1 parent 564107ecc7
commit 468b7b4680
1 file changed
+2 -1
@@ -52,7 +52,6 @@ import java.nio.file.Path;
import java.nio.file.StandardCopyOption; import java.nio.file.StandardCopyOption;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Random; import java.util.Random;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
@@ -395,6 +394,7 @@ public class ExportJob {
private void setup(ReplayServer replayServer) { private void setup(ReplayServer replayServer) {
Minecraft minecraft = Minecraft.getInstance(); Minecraft minecraft = Minecraft.getInstance();
if (replayServer.getReplayTick() != this.settings.startTick()) {
int currentTick = Math.max(0, this.settings.startTick() - 40); int currentTick = Math.max(0, this.settings.startTick() - 40);
// Ensure replay server is paused at currentTick // Ensure replay server is paused at currentTick
@@ -432,6 +432,7 @@ public class ExportJob {
// Ensured replay server is paused at startTick // Ensured replay server is paused at startTick
this.setServerTickAndWait(replayServer, this.settings.startTick(), true); this.setServerTickAndWait(replayServer, this.settings.startTick(), true);
this.runClientTick(false); this.runClientTick(false);
}
// Remove screen // Remove screen
minecraft.setScreen(null); minecraft.setScreen(null);