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 ceaf263bc5..d7ebb33e94 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Fireball.java +++ b/paper-api/src/main/java/org/bukkit/entity/Fireball.java @@ -10,26 +10,56 @@ public interface Fireball extends Projectile, Explosive { /** * 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. + * This is a convenience method, it will change the velocity direction and + * acceleration direction, while keeping the power the same. *
- * Also Note: that this method and {@link #setVelocity(Vector)} will override each other. + * Note: This method only uses the direction of the vector and will + * normalize (a copy of) it. + *
+ * Special Case: When the given direction is + * {@link Vector#isZero() zero}, the velocity and acceleration will also be + * set to zero without keeping the power. * * @param direction the direction this fireball should be flying towards * @see #setVelocity(Vector) + * @see #setAcceleration(Vector) */ public void setDirection(@NotNull Vector direction); /** - * Retrieve the direction this fireball is heading toward + * Retrieve the direction this fireball is heading toward. * The returned vector is not normalized. * * @return the direction + * @see #getAcceleration() + * @deprecated badly named method, returns the value of + * {@link #getAcceleration()} */ @NotNull + @Deprecated(since = "1.20.6") public Vector getDirection(); + /** + * Sets the acceleration of the fireball. + * + * The acceleration gets applied to the velocity every tick, depending on + * the specific type of the fireball a damping / drag factor is applied so + * that the velocity does not grow into infinity. + *
+ * Note: that the client may not respect non-default acceleration + * power and will therefore mispredict the location of the fireball, causing + * visual stutter. + * + * @param acceleration the acceleration + */ + void setAcceleration(@NotNull Vector acceleration); + + /** + * Retrieve the acceleration of this fireball. + * + * @return the acceleration + */ + @NotNull + Vector getAcceleration(); }