.tmcpr files are now being deleted upon starting the game
Finally fixed Replay code Finally fixed Lighting code
This commit is contained in:
@@ -50,8 +50,6 @@ public class ReplayHandler {
|
||||
|
||||
public static long lastExit = 0;
|
||||
|
||||
private static float gamma = 0f;
|
||||
|
||||
private static Entity currentEntity = null;
|
||||
|
||||
public static void insertPacketInstantly(Packet p) {
|
||||
@@ -85,17 +83,13 @@ public class ReplayHandler {
|
||||
return currentEntity == cameraEntity;
|
||||
}
|
||||
|
||||
public static void setInitialGamma(float initial) {
|
||||
gamma = initial;
|
||||
}
|
||||
|
||||
public static float getInitialGamma() {
|
||||
return gamma;
|
||||
}
|
||||
|
||||
public static void setInPath(boolean replaying) {
|
||||
inPath = replaying;
|
||||
}
|
||||
|
||||
public static void stopHurrying() {
|
||||
if(replaySender != null) replaySender.stopHurrying();
|
||||
}
|
||||
|
||||
public static void startPath(boolean save) {
|
||||
if(!ReplayHandler.isInPath()) ReplayProcess.startReplayProcess(save);
|
||||
|
||||
@@ -114,9 +114,10 @@ public class ReplayProcess {
|
||||
}
|
||||
}
|
||||
ReplayHandler.setInPath(false);
|
||||
ReplayHandler.stopHurrying();
|
||||
MCTimerHandler.setActiveTimer();
|
||||
ReplayHandler.setSpeed(previousReplaySpeed);
|
||||
//ReplayHandler.setSpeed(0);
|
||||
ReplayHandler.setSpeed(0);
|
||||
}
|
||||
|
||||
private static boolean blocked = false;
|
||||
@@ -297,9 +298,9 @@ public class ReplayProcess {
|
||||
}
|
||||
}
|
||||
|
||||
Integer curPos = null;
|
||||
Integer curTimestamp = null;
|
||||
if(timeLinear != null && timeCount > 1) {
|
||||
curPos = timeLinear.getPoint(Math.max(0, Math.min(1, timePos)));
|
||||
curTimestamp = timeLinear.getPoint(Math.max(0, Math.min(1, timePos)));
|
||||
}
|
||||
|
||||
if(pos != null) {
|
||||
@@ -316,7 +317,7 @@ public class ReplayProcess {
|
||||
EnchantmentTimer.increaseRecordingTime((1000/ReplayMod.replaySettings.getVideoFramerate()));
|
||||
}
|
||||
|
||||
if(curPos != null && curPos != ReplayHandler.getDesiredTimestamp()) ReplayHandler.setReplayTime(curPos);
|
||||
if(curTimestamp != null && curTimestamp != ReplayHandler.getDesiredTimestamp()) ReplayHandler.setReplayTime(curTimestamp);
|
||||
|
||||
//splinePos = (index of last entry + add) / total entries
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ import eu.crushedpixel.replaymod.holders.Position;
|
||||
import eu.crushedpixel.replaymod.recording.ConnectionEventHandler;
|
||||
import eu.crushedpixel.replaymod.recording.ReplayMetaData;
|
||||
import eu.crushedpixel.replaymod.reflection.MCPNames;
|
||||
import eu.crushedpixel.replaymod.registry.LightingHandler;
|
||||
import eu.crushedpixel.replaymod.timer.MCTimerHandler;
|
||||
import eu.crushedpixel.replaymod.utils.ReplayFileIO;
|
||||
|
||||
@@ -81,9 +82,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
private long lastTimeStamp, lastPacketSent;
|
||||
|
||||
private boolean hasRestarted = false;
|
||||
|
||||
private long toleratedTimeStamp = Long.MAX_VALUE;
|
||||
|
||||
|
||||
private File replayFile;
|
||||
private boolean active = true;
|
||||
private ZipFile archive;
|
||||
@@ -131,6 +130,10 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
public int replayLength() {
|
||||
return replayLength;
|
||||
}
|
||||
|
||||
public void stopHurrying() {
|
||||
hurryToTimestamp = false;
|
||||
}
|
||||
|
||||
public void terminateReplay() {
|
||||
terminate = true;
|
||||
@@ -150,11 +153,6 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
if(!(ReplayHandler.isInPath() && ReplayProcess.isVideoRecording())) setReplaySpeed(replaySpeed);
|
||||
|
||||
if((millis < currentTimeStamp && !isHurrying())) {
|
||||
if(ReplayHandler.isInPath()) {
|
||||
if(millis < toleratedTimeStamp) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
startFromBeginning = true;
|
||||
}
|
||||
|
||||
@@ -207,8 +205,6 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ReplayHandler.setInitialGamma(mc.gameSettings.gammaSetting);
|
||||
|
||||
this.replayFile = replayFile;
|
||||
this.networkManager = nm;
|
||||
if(("."+FilenameUtils.getExtension(replayFile.getAbsolutePath())).equals(ConnectionEventHandler.ZIP_FILE_EXTENSION)) {
|
||||
@@ -294,12 +290,6 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
|
||||
lastTimeStamp = currentTimeStamp;
|
||||
|
||||
if(ReplayHandler.isInPath()) {
|
||||
toleratedTimeStamp = lastTimeStamp;
|
||||
} else {
|
||||
toleratedTimeStamp = -1;
|
||||
}
|
||||
|
||||
if(hurryToTimestamp && currentTimeStamp >= desiredTimeStamp && !startFromBeginning) {
|
||||
hurryToTimestamp = false;
|
||||
if(!ReplayHandler.isInPath() || hasRestarted) {
|
||||
|
||||
Reference in New Issue
Block a user