Retain camera position when switching to and from quick mode

This commit is contained in:
Jonas Herzig
2018-12-18 10:44:57 +01:00
parent 1670ed4e80
commit 2737077828

View File

@@ -356,6 +356,14 @@ public class ReplayHandler {
throw new IllegalStateException("Cannot switch to quick mode while in async mode.");
}
this.quickMode = quickMode;
CameraEntity cam = getCameraEntity();
if (cam != null) {
targetCameraPosition = new Location(cam.posX, cam.posY, cam.posZ, cam.rotationYaw, cam.rotationPitch);
} else {
targetCameraPosition = null;
}
if (quickMode) {
quickReplaySender.register();
quickReplaySender.restart();
@@ -365,6 +373,8 @@ public class ReplayHandler {
fullReplaySender.sendPacketsTill(0);
fullReplaySender.sendPacketsTill(quickReplaySender.currentTimeStamp());
}
moveCameraToTargetPosition();
}
public boolean isQuickMode() {