From fcfb9213f66959667ae63523d593e2e5cf567af9 Mon Sep 17 00:00:00 2001 From: Jesse McKee Date: Fri, 31 May 2024 17:02:39 -0500 Subject: [PATCH] Add Keys.TELEPORT_DURATION for DisplayEntity Closes #2508 --- src/main/java/org/spongepowered/api/data/Keys.java | 5 +++++ .../spongepowered/api/entity/display/DisplayEntity.java | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/org/spongepowered/api/data/Keys.java b/src/main/java/org/spongepowered/api/data/Keys.java index 29796d2198..8efdf7d032 100644 --- a/src/main/java/org/spongepowered/api/data/Keys.java +++ b/src/main/java/org/spongepowered/api/data/Keys.java @@ -3113,6 +3113,11 @@ public final class Keys { */ public static final Key> TARGET_POSITION = Keys.key(ResourceKey.sponge("target_position"), Vector3i.class); + /** + * The teleport duration of a {@link DisplayEntity} + */ + public static final Key> TELEPORT_DURATION = Keys.key(ResourceKey.sponge("teleport_duration"), Ticks.class); + /** * The {@link TemperatureModifier} of a {@link Biome}. * Readonly diff --git a/src/main/java/org/spongepowered/api/entity/display/DisplayEntity.java b/src/main/java/org/spongepowered/api/entity/display/DisplayEntity.java index ea6e470db0..0173171c71 100644 --- a/src/main/java/org/spongepowered/api/entity/display/DisplayEntity.java +++ b/src/main/java/org/spongepowered/api/entity/display/DisplayEntity.java @@ -64,6 +64,15 @@ default Ticks interpolationDelay() { return this.require(Keys.INTERPOLATION_DELAY); } + /** + * Returns the duration of the teleportation + * + * @return the duration of the teleportation + */ + default Ticks teleportDuration() { + return this.require(Keys.TELEPORT_DURATION); + } + default BillboardType billboardType() { return this.require(Keys.BILLBOARD_TYPE); }