Warning, GIGANTIC COMMIT!
Replaced Keyframe subclasses with Generic Types of Keyframe and replaced all instanceof calls Replaced implementations of Linear and Spline interpolation to interpolate any Object that extends KeyframeValue and contains at least one public double Field. I'll need this for Keyframe interpolation in CustomImageObject Transformations Made MarkerKeyframe *no* subclass of Keyframe to avoid conflicts with PositionKeyframe in instanceof checks for Keyframe#getValue Created KeyframeList which extends ArrayList to provide some helping functions which DRY up the ReplayHandler Split up ReplayHandler's keyframeList into timeKeyframeList and positionKeyframeList
This commit is contained in:
@@ -1,27 +1,38 @@
|
||||
package eu.crushedpixel.replaymod.holders;
|
||||
|
||||
import eu.crushedpixel.replaymod.interpolation.KeyframeValue;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class Position {
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper=true)
|
||||
public class Position extends KeyframeValue {
|
||||
|
||||
private double x, y, z;
|
||||
private float pitch, yaw, roll;
|
||||
public double x, y, z;
|
||||
public double pitch, yaw, roll;
|
||||
|
||||
public Position(int entityID) {
|
||||
this(Minecraft.getMinecraft().theWorld.getEntityByID(entityID));
|
||||
private Integer spectatedEntityID;
|
||||
|
||||
public Position(int entityID, boolean spectate) {
|
||||
this(Minecraft.getMinecraft().theWorld.getEntityByID(entityID), spectate);
|
||||
}
|
||||
|
||||
public Position(Entity e) {
|
||||
this(e.posX, e.posY, e.posZ, e.rotationPitch, e.rotationYaw);
|
||||
public Position(Entity e, boolean spectate) {
|
||||
this(e.posX, e.posY, e.posZ, e.rotationPitch, e.rotationYaw, spectate ? e.getEntityId() : null);
|
||||
}
|
||||
|
||||
public Position(double x, double y, double z, float pitch, float yaw, Integer spectatedEntityID) {
|
||||
this(x, y, z, pitch, yaw, 0, spectatedEntityID);
|
||||
}
|
||||
|
||||
public Position(double x, double y, double z, float pitch, float yaw) {
|
||||
this(x, y, z, pitch, yaw, 0);
|
||||
this(x, y, z, pitch, yaw, 0, null);
|
||||
}
|
||||
|
||||
public double distanceSquared(double x, double y, double z) {
|
||||
|
||||
Reference in New Issue
Block a user