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
|
@ -12,10 +12,10 @@ This can replace many uses of BlockPhysicsEvent
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d0421a4cbcb672cc06b40ad41fc06a67f6d2dbbb
|
||||
index 0000000000000000000000000000000000000000..c0742b58ca2c098c27394915b624889ece1a9168
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java
|
||||
@@ -0,0 +1,123 @@
|
||||
@@ -0,0 +1,122 @@
|
||||
+package com.destroystokyo.paper.event.block;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
|
@ -79,9 +79,8 @@ index 0000000000000000000000000000000000000000..d0421a4cbcb672cc06b40ad41fc06a67
|
|||
+ /**
|
||||
+ * @return The new state of this block (Air, or a Fluid type)
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public BlockData getNewState() {
|
||||
+ return this.newState;
|
||||
+ public @NotNull BlockData getNewState() {
|
||||
+ return this.newState.clone();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue