2023-10-10 23:09:45 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: TrollyLoki <trollyloki@gmail.com>
|
|
|
|
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
|
2024-01-13 18:34:33 +01:00
|
|
|
index 2783e218d5e5c24787429237974e196761f4d02b..1d8aab2fda18c6e2bb30f6ba4a6325263267b628 100644
|
2023-10-10 23:09:45 +02:00
|
|
|
--- 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 {
|
2023-10-27 01:34:58 +02:00
|
|
|
this.update(); // SPIGOT-6579
|
2023-10-10 23:09:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // 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();
|
|
|
|
+ }
|
2024-01-13 18:34:33 +01:00
|
|
|
+ // Paper end - set direction without normalizing
|
2023-10-10 23:09:45 +02:00
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public AbstractHurtingProjectile getHandle() {
|
2023-10-27 01:34:58 +02:00
|
|
|
return (AbstractHurtingProjectile) this.entity;
|