Added SpectatingMethod attribute to SpectatorData object, and more variables for the SHOULDER_CAM SpectatingMethod
This commit is contained in:
@@ -3,17 +3,43 @@ package eu.crushedpixel.replaymod.holders;
|
|||||||
import eu.crushedpixel.replaymod.interpolation.AdvancedPositionLinearInterpolation;
|
import eu.crushedpixel.replaymod.interpolation.AdvancedPositionLinearInterpolation;
|
||||||
import eu.crushedpixel.replaymod.interpolation.AdvancedPositionSplineInterpolation;
|
import eu.crushedpixel.replaymod.interpolation.AdvancedPositionSplineInterpolation;
|
||||||
import eu.crushedpixel.replaymod.interpolation.Interpolation;
|
import eu.crushedpixel.replaymod.interpolation.Interpolation;
|
||||||
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper=true)
|
@EqualsAndHashCode(callSuper=true)
|
||||||
public class SpectatorData extends AdvancedPosition {
|
public class SpectatorData extends AdvancedPosition {
|
||||||
|
|
||||||
private Integer spectatedEntityID;
|
private Integer spectatedEntityID;
|
||||||
|
|
||||||
|
private SpectatingMethod spectatingMethod = SpectatingMethod.FIRST_PERSON;
|
||||||
|
|
||||||
|
//these fields are only relevant for SpectatingMethod.SHOULDER_CAM
|
||||||
|
/**
|
||||||
|
* The shoulder camera's distance (in blocks) to the player
|
||||||
|
*/
|
||||||
|
private double shoulderCamDistance = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The shoulder camera's pitch offset in degrees, value between -90 and 90
|
||||||
|
*/
|
||||||
|
private float shoulderCamPitchOffset = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The shoulder camera's rotation around the player in degrees
|
||||||
|
*/
|
||||||
|
private float shoulderCamYawOffset = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The distance between the automatically calculated position keyframes in milliseconds
|
||||||
|
*/
|
||||||
|
private int shoulderCamSmoothness = 500;
|
||||||
|
|
||||||
|
|
||||||
public int getSpectatedEntityID() {
|
public int getSpectatedEntityID() {
|
||||||
if(spectatedEntityID == null) throw new IllegalStateException();
|
if(spectatedEntityID == null) throw new IllegalStateException();
|
||||||
return spectatedEntityID;
|
return spectatedEntityID;
|
||||||
@@ -56,4 +82,8 @@ public class SpectatorData extends AdvancedPosition {
|
|||||||
public Interpolation getLinearInterpolator() {
|
public Interpolation getLinearInterpolator() {
|
||||||
return new AdvancedPositionLinearInterpolation();
|
return new AdvancedPositionLinearInterpolation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum SpectatingMethod {
|
||||||
|
FIRST_PERSON, SHOULDER_CAM
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user