From 053943414fcea975b3c77097b71082383471e18d Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 25 Sep 2023 19:20:39 +1000 Subject: [PATCH] SPIGOT-7489: Add TeleportDuration to Display Entity By: Doc --- .../org/bukkit/craftbukkit/entity/CraftDisplay.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftDisplay.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftDisplay.java index c5f28d69b..0f70d076e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftDisplay.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftDisplay.java @@ -53,6 +53,17 @@ public class CraftDisplay extends CraftEntity implements Display { getHandle().setTransformationInterpolationDuration(duration); } + @Override + public int getTeleportDuration() { + return this.getHandle().getEntityData().get(net.minecraft.world.entity.Display.DATA_POS_ROT_INTERPOLATION_DURATION_ID); + } + + @Override + public void setTeleportDuration(int duration) { + Preconditions.checkArgument(duration >= 0 && duration <= 59, "duration (%s) cannot be lower than 0 or higher than 59", duration); + this.getHandle().getEntityData().set(net.minecraft.world.entity.Display.DATA_POS_ROT_INTERPOLATION_DURATION_ID, duration); + } + @Override public float getViewRange() { return getHandle().getViewRange();