26
26
27
27
import org .spongepowered .api .data .Keys ;
28
28
import org .spongepowered .api .entity .Entity ;
29
+ import org .spongepowered .api .util .Ticks ;
30
+ import org .spongepowered .api .util .Transform ;
29
31
30
32
import java .util .Optional ;
31
33
32
34
public interface DisplayEntity extends Entity {
33
35
34
- // TODO rotation/transformation?
36
+ /**
37
+ * Returns the transform.
38
+ * <p>
39
+ * Supports interpolation.
40
+ * </p>
41
+ *
42
+ * @return the transform
43
+ */
44
+ default Transform transform () {
45
+ return this .require (Keys .TRANSFORM );
46
+ }
35
47
36
- // TODO interpolation? textopacity/backgroundcolor
48
+ /**
49
+ * Returns the duration of the interpolation
50
+ *
51
+ * @return the duration of the interpolation
52
+ */
53
+ default Ticks interpolationDuration () {
54
+ return this .require (Keys .INTERPOLATION_DURATION );
55
+ }
56
+
57
+ /**
58
+ * Returns the delay to the start of the interpolation
59
+ *
60
+ * @return the delay to the start of the interpolation
61
+ */
62
+ default Ticks interpolationDelay () {
63
+ return this .require (Keys .INTERPOLATION_DELAY );
64
+ }
37
65
38
66
default BillboardType billboardType () {
39
67
return this .require (Keys .BILLBOARD_TYPE );
@@ -57,10 +85,36 @@ default Optional<Integer> blockLight() {
57
85
return this .get (Keys .BLOCK_LIGHT );
58
86
}
59
87
60
- // TODO view_range float/double
61
88
62
- // TODO shadow radius float/double 0=noshadow
63
- // TODO shadow strength float/double 1=default
89
+ /**
90
+ * Returns the shadow radius.
91
+ *
92
+ * @return the shadow radius.
93
+ */
94
+ default Double shadowRadius () {
95
+ return this .require (Keys .SHADOW_RADIUS );
96
+ }
97
+
98
+ /**
99
+ * Returns the shadow strength or darkness.
100
+ * <p>Vanilla defaults to 1</p>
101
+ *
102
+ * @return the shadow strength.
103
+ */
104
+ default Double shadowStrength () {
105
+ return this .require (Keys .SHADOW_STRENGTH );
106
+ }
107
+
108
+
109
+ /**
110
+ * Returns the range at which the display entity is rendered.
111
+ *
112
+ * @return the view range
113
+ */
114
+ default Double viewRange () {
115
+ return this .require (Keys .VIEW_RANGE );
116
+ }
117
+
64
118
// TODO bounding box (maybe BASE_SIZE if this is not smth. else in the entity)
65
119
// TODO glow_color_override -1 = use team color
66
120
0 commit comments