From eb7e6bde61661b5be7fc15f619cfa2d957e08775 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 4 May 2024 19:34:24 +1000 Subject: [PATCH] SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it By: DerFrZocker --- .../src/main/java/org/bukkit/entity/Fireball.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/entity/Fireball.java b/paper-api/src/main/java/org/bukkit/entity/Fireball.java index 7a44707f23..ceaf263bc5 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Fireball.java +++ b/paper-api/src/main/java/org/bukkit/entity/Fireball.java @@ -9,14 +9,23 @@ import org.jetbrains.annotations.NotNull; public interface Fireball extends Projectile, Explosive { /** - * Fireballs fly straight and do not take setVelocity(...) well. + * Sets the direction the fireball should be flying towards. + * The direction vector will be normalized and the default speed will be applied. + *
+ * To also change the speed of the fireball, use {@link #setVelocity(Vector)}. + * Note: that the client may not respect non-default speeds and will therefore + * mispredict the location of the fireball, causing visual stutter. + *
+ * Also Note: that this method and {@link #setVelocity(Vector)} will override each other. * - * @param direction the direction this fireball is flying toward + * @param direction the direction this fireball should be flying towards + * @see #setVelocity(Vector) */ public void setDirection(@NotNull Vector direction); /** * Retrieve the direction this fireball is heading toward + * The returned vector is not normalized. * * @return the direction */