Merge branch '1.8' into 1.9.4
5b3284fUpdate jGui and ReplayStudio (fixes #33)61d6fd4Close replay file zip after recording (fixes #32)00bcc9eFix paths of files that are supposed to be in the mc data dir (fixes #40)e6a789dFix camera rotation when jumping in time (fixes #39)50b53fcAdd a way to register key bindings triggered every render tick (fixes #31)a817c73Prevent GUIs of other mods from opening during replayd64ef8bHide NPCs in the Player Overview GUI (fixes #29)1f2c05eFix spectating player entities past death and respawn (fixes #36)ad2893bFix vanilla bug caused by unremovable entities in the entityList of ClientWorld (fixes #29)c934cb9Fix spawn player packet being sent twice6efbf91Handle F1 properly while mouse is visible in the replay overlay (fixes #30)9add2afDeselect keyframe when pressing "V" aka. sync timelines (fixes #27)
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
package com.replaymod.render;
|
||||
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.util.ReportedException;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@Mod(modid = ReplayModRender.MOD_ID, useMetadata = true)
|
||||
public class ReplayModRender {
|
||||
public static final String MOD_ID = "replaymod-render";
|
||||
@@ -32,6 +38,17 @@ public class ReplayModRender {
|
||||
core.getSettingsRegistry().register(Setting.class);
|
||||
}
|
||||
|
||||
public File getVideoFolder() {
|
||||
String path = core.getSettingsRegistry().get(Setting.RENDER_PATH);
|
||||
File folder = new File(path.startsWith("./") ? core.getMinecraft().mcDataDir : null, path);
|
||||
try {
|
||||
FileUtils.forceMkdir(folder);
|
||||
} catch (IOException e) {
|
||||
throw new ReportedException(CrashReport.makeCrashReport(e, "Cannot create video folder."));
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
|
||||
public Configuration getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ public class VideoWriter implements FrameConsumer<RGBFrame> {
|
||||
System.out.println("Starting " + settings.getExportCommand() + " with args: " + commandArgs);
|
||||
String[] cmdline = new CommandLine(executable).addArguments(commandArgs).toStrings();
|
||||
process = new ProcessBuilder(cmdline).directory(outputFolder).start();
|
||||
OutputStream exportLogOut = new TeeOutputStream(new FileOutputStream("export.log"), ffmpegLog);
|
||||
File exportLogFile = new File(Minecraft.getMinecraft().mcDataDir, "export.log");
|
||||
OutputStream exportLogOut = new TeeOutputStream(new FileOutputStream(exportLogFile), ffmpegLog);
|
||||
new StreamPipe(process.getInputStream(), exportLogOut).start();
|
||||
new StreamPipe(process.getErrorStream(), exportLogOut).start();
|
||||
outputStream = process.getOutputStream();
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.InstanceCreator;
|
||||
import com.replaymod.render.RenderSettings;
|
||||
import com.replaymod.render.ReplayModRender;
|
||||
import com.replaymod.render.Setting;
|
||||
import com.replaymod.render.rendering.VideoRenderer;
|
||||
import com.replaymod.replay.ReplayHandler;
|
||||
import com.replaymod.replaystudio.pathing.path.Timeline;
|
||||
@@ -410,7 +409,7 @@ public class GuiRenderSettings extends GuiScreen implements Closeable {
|
||||
|
||||
private File generateOutputFile(RenderSettings.EncodingPreset encodingPreset) {
|
||||
String fileName = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss").format(new Date());
|
||||
File folder = new File(ReplayModRender.instance.getCore().getSettingsRegistry().get(Setting.RENDER_PATH));
|
||||
File folder = ReplayModRender.instance.getVideoFolder();
|
||||
return new File(folder, fileName + "." + encodingPreset.getFileExtension());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user