Clone mutable types in events when changes are discarded (#10333)
This commit is contained in:
parent
05fe15e0fc
commit
de620b8480
10 changed files with 175 additions and 25 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue