-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make setVelocity method of Fireballs change the travel direction to a…
…n arbitrary vector (#9815)
- Loading branch information
1 parent
72f7945
commit 69ce927
Showing
4 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
patches/server/1037-Make-setVelocity-method-of-Fireballs-change-the-trav.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 | ||
index e04500dcdc5b72cca7ac81b5d12e76822db9c8c5..22d59ca52229dc566b8dfb460b92ecd6318e6db0 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 { | ||
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) entity; |