From c123363a9f06db992ea114f1748ed274bf992e5f Mon Sep 17 00:00:00 2001 From: johni0702 Date: Fri, 11 Mar 2016 13:04:57 +0100 Subject: [PATCH] We cannot use transformAndConcat in this Guava version --- .../replaymod/pathing/player/AbstractTimelinePlayer.java | 8 ++++---- .../replaymod/simplepathing/gui/GuiKeyframeTimeline.java | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/replaymod/pathing/player/AbstractTimelinePlayer.java b/src/main/java/com/replaymod/pathing/player/AbstractTimelinePlayer.java index c0a579d0..919ea5a7 100644 --- a/src/main/java/com/replaymod/pathing/player/AbstractTimelinePlayer.java +++ b/src/main/java/com/replaymod/pathing/player/AbstractTimelinePlayer.java @@ -1,7 +1,7 @@ package com.replaymod.pathing.player; import com.google.common.base.Function; -import com.google.common.collect.FluentIterable; +import com.google.common.collect.Iterables; import com.google.common.collect.Ordering; import com.google.common.primitives.Longs; import com.google.common.util.concurrent.ListenableFuture; @@ -34,15 +34,15 @@ public abstract class AbstractTimelinePlayer { public ListenableFuture start(Timeline timeline) { this.timeline = timeline; - Iterator iter = FluentIterable.from(timeline.getPaths()) - .transformAndConcat(new Function>() { + Iterator iter = Iterables.concat(Iterables.transform(timeline.getPaths(), + new Function>() { @Nullable @Override public Iterable apply(@Nullable Path input) { assert input != null; return input.getKeyframes(); } - }).iterator(); + })).iterator(); if (!iter.hasNext()) { lastTimestamp = 0; } else { diff --git a/src/main/java/com/replaymod/simplepathing/gui/GuiKeyframeTimeline.java b/src/main/java/com/replaymod/simplepathing/gui/GuiKeyframeTimeline.java index 6c6af391..5e3648ab 100644 --- a/src/main/java/com/replaymod/simplepathing/gui/GuiKeyframeTimeline.java +++ b/src/main/java/com/replaymod/simplepathing/gui/GuiKeyframeTimeline.java @@ -1,7 +1,7 @@ package com.replaymod.simplepathing.gui; import com.google.common.base.Function; -import com.google.common.collect.FluentIterable; +import com.google.common.collect.Iterables; import com.replaymod.core.ReplayMod; import com.replaymod.pathing.path.Keyframe; import com.replaymod.pathing.path.Path; @@ -37,14 +37,14 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline>() { + for (Keyframe keyframe : Iterables.concat(Iterables.transform(mod.getCurrentTimeline().getPaths(), new Function>() { @Nullable @Override public Iterable apply(@Nullable Path input) { assert input != null; return input.getKeyframes(); } - })) { + }))) { if (keyframe.getTime() >= startTime && keyframe.getTime() <= endTime) { double relativeTime = keyframe.getTime() - startTime; int positonX = BORDER_LEFT + (int) (relativeTime / visibleTime * visibleWidth) - KEYFRAME_SIZE / 2;