aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1037-Make-setVelocity-method-of-Fireballs-change-the-trav.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/1037-Make-setVelocity-method-of-Fireballs-change-the-trav.patch')
-rw-r--r--patches/server/1037-Make-setVelocity-method-of-Fireballs-change-the-trav.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/server/1037-Make-setVelocity-method-of-Fireballs-change-the-trav.patch b/patches/server/1037-Make-setVelocity-method-of-Fireballs-change-the-trav.patch
new file mode 100644
index 0000000000..b36b8cf1f6
--- /dev/null
+++ b/patches/server/1037-Make-setVelocity-method-of-Fireballs-change-the-trav.patch
@@ -0,0 +1,30 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: TrollyLoki <[email protected]>
+Date: Tue, 10 Oct 2023 00:45:01 -0400
+Subject: [PATCH] Make setVelocity method of Fireballs change the travel
+ direction to an arbitrary vector
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
+index 2783e218d5e5c24787429237974e196761f4d02b..774ed1fdc909c911bf93a1b720285b43e9f728b8 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
+@@ -46,6 +46,18 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
+ this.update(); // SPIGOT-6579
+ }
+
++ // Paper start - set direction without normalizing
++ @Override
++ public void setVelocity(Vector velocity) {
++ Preconditions.checkArgument(velocity != null, "Vector velocity cannot be null");
++ velocity.checkFinite();
++ this.getHandle().xPower = velocity.getX();
++ this.getHandle().yPower = velocity.getY();
++ this.getHandle().zPower = velocity.getZ();
++ update();
++ }
++ // Paper end
++
+ @Override
+ public AbstractHurtingProjectile getHandle() {
+ return (AbstractHurtingProjectile) this.entity;