Markers are now subclasses of Keyframe
Markers can now be moved and jumped to on the Replay Timeline
This commit is contained in:
@@ -5,7 +5,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import eu.crushedpixel.replaymod.holders.KeyframeSet;
|
||||
import eu.crushedpixel.replaymod.holders.Marker;
|
||||
import eu.crushedpixel.replaymod.holders.MarkerKeyframe;
|
||||
import eu.crushedpixel.replaymod.holders.PlayerVisibility;
|
||||
import eu.crushedpixel.replaymod.recording.ReplayMetaData;
|
||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||
@@ -129,17 +129,17 @@ public class ReplayFile extends ZipFile {
|
||||
return getEntry(ENTRY_MARKERS);
|
||||
}
|
||||
|
||||
public Supplier<Marker[]> markers() {
|
||||
return new Supplier<Marker[]>() {
|
||||
public Supplier<MarkerKeyframe[]> markers() {
|
||||
return new Supplier<MarkerKeyframe[]>() {
|
||||
@Override
|
||||
public Marker[] get() {
|
||||
public MarkerKeyframe[] get() {
|
||||
try {
|
||||
ZipArchiveEntry entry = markersEntry();
|
||||
if (entry == null) {
|
||||
return null;
|
||||
}
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(getInputStream(entry)));
|
||||
return new Gson().fromJson(reader, Marker[].class);
|
||||
return new Gson().fromJson(reader, MarkerKeyframe[].class);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package eu.crushedpixel.replaymod.utils;
|
||||
import com.google.gson.Gson;
|
||||
import eu.crushedpixel.replaymod.ReplayMod;
|
||||
import eu.crushedpixel.replaymod.holders.KeyframeSet;
|
||||
import eu.crushedpixel.replaymod.holders.Marker;
|
||||
import eu.crushedpixel.replaymod.holders.MarkerKeyframe;
|
||||
import eu.crushedpixel.replaymod.holders.PacketData;
|
||||
import eu.crushedpixel.replaymod.holders.PlayerVisibility;
|
||||
import eu.crushedpixel.replaymod.recording.PacketSerializer;
|
||||
@@ -58,7 +58,7 @@ public class ReplayFileIO {
|
||||
return files;
|
||||
}
|
||||
|
||||
public static void writeReplayFile(File replayFile, File tempFile, ReplayMetaData metaData, Set<Marker> markers,
|
||||
public static void writeReplayFile(File replayFile, File tempFile, ReplayMetaData metaData, Set<MarkerKeyframe> markers,
|
||||
Map<String, File> resourcePacks, Map<Integer, String> resourcePackRequests) throws IOException {
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ReplayFileIO {
|
||||
zos.putNextEntry(new ZipEntry(ReplayFile.ENTRY_MARKERS));
|
||||
|
||||
pw = new PrintWriter(zos);
|
||||
pw.write(new Gson().toJson(markers.toArray(new Marker[markers.size()])));
|
||||
pw.write(new Gson().toJson(markers.toArray(new MarkerKeyframe[markers.size()])));
|
||||
pw.flush();
|
||||
zos.closeEntry();
|
||||
}
|
||||
@@ -332,7 +332,7 @@ public class ReplayFileIO {
|
||||
FileUtils.write(file, json);
|
||||
}
|
||||
|
||||
public static void writeMarkersToFile(Marker[] markers, File file) throws IOException {
|
||||
public static void writeMarkersToFile(MarkerKeyframe[] markers, File file) throws IOException {
|
||||
file.mkdirs();
|
||||
file.createNewFile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user