Added Core Mod to redirect the Enchantment Rendering getSystemTime() calls to a the EnchantmentTimer (glow now slows down)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package eu.crushedpixel.replaymod.timer;
|
||||
|
||||
import eu.crushedpixel.replaymod.replay.ReplayHandler;
|
||||
import eu.crushedpixel.replaymod.replay.ReplayProcess;
|
||||
|
||||
public class EnchantmentTimer {
|
||||
|
||||
private static long lastRealTime = System.currentTimeMillis();
|
||||
private static long lastFakeTime = System.currentTimeMillis();
|
||||
|
||||
private static long recordingTime = 0;
|
||||
|
||||
public static void resetRecordingTime() {
|
||||
recordingTime = 0;
|
||||
}
|
||||
|
||||
public static void increaseRecordingTime(long amount) {
|
||||
recordingTime += amount;
|
||||
}
|
||||
|
||||
public static long getEnchantmentTime() {
|
||||
if(!(ReplayHandler.isInPath() && ReplayProcess.isVideoRecording())) {
|
||||
if(ReplayHandler.isInReplay()) {
|
||||
long timeDiff = System.currentTimeMillis() - lastRealTime;
|
||||
double toAdd = timeDiff*ReplayHandler.getSpeed();
|
||||
lastFakeTime = Math.round(lastFakeTime+toAdd);
|
||||
lastRealTime = System.currentTimeMillis();
|
||||
return lastFakeTime;
|
||||
}
|
||||
lastFakeTime = lastRealTime = System.currentTimeMillis();
|
||||
return lastRealTime;
|
||||
}
|
||||
return recordingTime;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user