Skip to content

Commit fcfb921

Browse files
DrZoddiakFaithcaio
authored andcommitted
Add Keys.TELEPORT_DURATION for DisplayEntity
Closes #2508
1 parent eea04ca commit fcfb921

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/main/java/org/spongepowered/api/data/Keys.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3113,6 +3113,11 @@ public final class Keys {
31133113
*/
31143114
public static final Key<Value<Vector3i>> TARGET_POSITION = Keys.key(ResourceKey.sponge("target_position"), Vector3i.class);
31153115

3116+
/**
3117+
* The teleport duration of a {@link DisplayEntity}
3118+
*/
3119+
public static final Key<Value<Ticks>> TELEPORT_DURATION = Keys.key(ResourceKey.sponge("teleport_duration"), Ticks.class);
3120+
31163121
/**
31173122
* The {@link TemperatureModifier} of a {@link Biome}.
31183123
* Readonly

src/main/java/org/spongepowered/api/entity/display/DisplayEntity.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ default Ticks interpolationDelay() {
6464
return this.require(Keys.INTERPOLATION_DELAY);
6565
}
6666

67+
/**
68+
* Returns the duration of the teleportation
69+
*
70+
* @return the duration of the teleportation
71+
*/
72+
default Ticks teleportDuration() {
73+
return this.require(Keys.TELEPORT_DURATION);
74+
}
75+
6776
default BillboardType billboardType() {
6877
return this.require(Keys.BILLBOARD_TYPE);
6978
}

0 commit comments

Comments
 (0)