SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
Bukkit/Spigot 2024-05-04 19:34:24 +10:00
parent 92293c1b89
commit eb7e6bde61

View file

@ -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.
* <br>
* To also change the speed of the fireball, use {@link #setVelocity(Vector)}.
* <b>Note:</b> that the client may not respect non-default speeds and will therefore
* mispredict the location of the fireball, causing visual stutter.
* <br>
* <b>Also Note:</b> 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
*/