Clone mutable types in events when changes are discarded (#10333)

This commit is contained in:
Jake Potrebic 2024-03-20 13:42:29 -07:00 committed by GitHub
parent 05fe15e0fc
commit de620b8480
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 175 additions and 25 deletions

View file

@ -7,7 +7,7 @@ Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..5804497f34bac9a9b6b16c6e5decb0119467df7b
index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee4b29e109
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java
@@ -0,0 +1,87 @@
@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..5804497f34bac9a9b6b16c6e5decb011
+ */
+ @NotNull
+ public Location getLoc() {
+ return this.location;
+ return this.location.clone();
+ }
+
+ @Override