Added support for legacy Spectator Keyframes in LegacyKeyframeSetAdapter

This commit is contained in:
CrushedPixel
2015-07-14 12:07:35 +02:00
parent 25f7b8dd0c
commit 9953bdf357

View File

@@ -40,7 +40,7 @@ public class LegacyKeyframeSetAdapter extends TypeAdapter<KeyframeSet[]> {
in.beginArray();
while(in.hasNext()) {
Keyframe<AdvancedPosition> newKeyframe = new Keyframe<AdvancedPosition>();
Integer spectatedEntityID = null;
in.beginObject();
while(in.hasNext()) {
String jsonKeyframeTag = in.nextName();
@@ -49,8 +49,11 @@ public class LegacyKeyframeSetAdapter extends TypeAdapter<KeyframeSet[]> {
newKeyframe.setValue(position);
} else if("realTimestamp".equals(jsonKeyframeTag)) {
newKeyframe.setRealTimestamp(in.nextInt());
} else if("spectatedEntityID".equals(jsonKeyframeTag)) {
spectatedEntityID = in.nextInt();
}
}
newKeyframe.getValue().setSpectatedEntityID(spectatedEntityID);
in.endObject();
keyframes.add(newKeyframe);