Merge branch '1.8' into 1.8.9

1ffeb01 Update jGui
c122d30 Merge branch '1.8-path-segments' into 1.8
27fd25a Fix crash when server responds with garbage to language query (fixes #51)
db6b0ff Fix / by 0 when two spectator keyframes are closer than 50ms (fixes #60)
d61d0ac Fix hand of invisible spectated player being visible (fixes #59)
f7460f9 Re-enable time path after path playback (fixes #55)
bdbffd5 Add Catmull-Rom spline interpolator to simplepathing
5cbfd28 Generate interpolator settings from InterpolatorType enum
6095aef Fix loading and storing of default interpolator with settings
2c64030 Refactor simple pathing timeline logic into dedicated class with unit tests Fix logic for user-set interpolators
cd16211 Register new Property to imply that the path segment following a keyframe has a user-set interpolator instead of the default Modified Keyframe GUI to allow for custom Path interpolator
This commit is contained in:
johni0702
2017-01-29 11:25:30 +01:00
16 changed files with 1851 additions and 389 deletions

View File

@@ -9,10 +9,10 @@ import com.replaymod.replaystudio.pathing.interpolation.Interpolator;
import com.replaymod.replaystudio.pathing.path.Keyframe;
import com.replaymod.replaystudio.pathing.path.Path;
import com.replaymod.replaystudio.pathing.path.PathSegment;
import com.replaymod.replaystudio.pathing.path.Timeline;
import com.replaymod.replaystudio.util.EntityPositionTracker;
import com.replaymod.replaystudio.util.Location;
import com.replaymod.simplepathing.ReplayModSimplePathing;
import com.replaymod.simplepathing.SPTimeline;
import com.replaymod.simplepathing.gui.GuiPathing;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
@@ -68,11 +68,11 @@ public class PathPreviewRenderer {
if (guiPathing == null) return;
EntityPositionTracker entityTracker = guiPathing.getEntityTracker();
Timeline timeline = mod.getCurrentTimeline();
SPTimeline timeline = mod.getCurrentTimeline();
if (timeline == null) return;
Path path = timeline.getPaths().get(GuiPathing.POSITION_PATH);
Path path = timeline.getPositionPath();
if (path.getKeyframes().isEmpty()) return;
Path timePath = timeline.getPaths().get(GuiPathing.TIME_PATH);
Path timePath = timeline.getTimePath();
path.update();
@@ -97,8 +97,8 @@ public class PathPreviewRenderer {
if (spectator && entityTracker == null) {
continue; // Cannot render spectator positions when entity tracker is not yet loaded
}
// Spectator segments have 20 lines per second whereas normal segments have a fixed 100
long steps = spectator ? diff / 50 : 100;
// Spectator segments have 20 lines per second (at least 10) whereas normal segments have a fixed 100
long steps = spectator ? Math.max(diff / 50, 10) : 100;
Triple<Double, Double, Double> prevPos = null;
for (int i = 0; i <= steps; i++) {
long time = start.getTime() + diff * i / steps;
@@ -240,7 +240,7 @@ public class PathPreviewRenderer {
float posY = 0f;
float size = 10f / ReplayMod.TEXTURE_SIZE;
if (keyframe == mod.getSelectedKeyframe()) {
if (mod.isSelected(keyframe)) {
posY += size;
}