Expose power on fireballs (#10302)

This commit is contained in:
TonytheMacaroni
2024-03-20 17:33:34 -04:00
parent 3e27ced8ce
commit b17ca0b19e
4 changed files with 65 additions and 31 deletions

View File

@@ -9,6 +9,7 @@ Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: booky10 <boooky10@gmail.com>
Co-authored-by: Amin <amin.haddou@frg.wwschool.de>
Co-authored-by: TrollyLoki <trollyloki@gmail.com>
diff --git a/src/main/java/io/papermc/paper/entity/SchoolableFish.java b/src/main/java/io/papermc/paper/entity/SchoolableFish.java
new file mode 100644
@@ -413,6 +414,43 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ int getLifetimeTicks();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Fireball.java b/src/main/java/org/bukkit/entity/Fireball.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Fireball.java
+++ b/src/main/java/org/bukkit/entity/Fireball.java
@@ -0,0 +0,0 @@ public interface Fireball extends Projectile, Explosive {
@NotNull
public Vector getDirection();
+ // Paper start - Expose power on fireball projectiles
+ /**
+ * {@inheritDoc}
+ * <p>
+ * Note: For fireball entities, their movement is also controlled by their power.
+ *
+ * @param velocity New velocity to travel with
+ * @see #setPower(Vector)
+ */
+ @Override
+ public void setVelocity(@NotNull Vector velocity);
+
+ /**
+ * Sets the power of a fireball. The power determines the direction and magnitude of its acceleration.
+ *
+ * @param power the power
+ */
+ public void setPower(@NotNull Vector power);
+
+ /**
+ * Gets the power of a fireball. The power determines the direction and magnitude of its acceleration.
+ *
+ * @return the power
+ */
+ @NotNull
+ public Vector getPower();
+ // Paper end - Expose power on fireball projectiles
+
}
diff --git a/src/main/java/org/bukkit/entity/Fox.java b/src/main/java/org/bukkit/entity/Fox.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Fox.java