SPIGOT-7489: Add TeleportDuration to Display Entity

This commit is contained in:
Doc 2023-09-25 19:20:39 +10:00 committed by md_5
parent 8d0fea4576
commit df3738a241
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -53,6 +53,17 @@ public class CraftDisplay extends CraftEntity implements Display {
getHandle().setTransformationInterpolationDuration(duration); 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 @Override
public float getViewRange() { public float getViewRange() {
return getHandle().getViewRange(); return getHandle().getViewRange();