Allow preventing BlockDestroyEvent from dropping items (#8349)
This commit is contained in:
parent
09904fd780
commit
36a5f150c5
9 changed files with 30 additions and 22 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..28255dc39eab5faf324d1fe556ab12daed527ff6
|
||||
index 0000000000000000000000000000000000000000..051b2ef76a914228338fa28553ad739bd2a0278c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java
|
||||
@@ -0,0 +1,92 @@
|
||||
@@ -0,0 +1,99 @@
|
||||
+package com.destroystokyo.paper.event.block;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
|
@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..28255dc39eab5faf324d1fe556ab12da
|
|||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ @NotNull private final BlockData newState;
|
||||
+ private final boolean willDrop;
|
||||
+ private boolean willDrop;
|
||||
+ private boolean playEffect = true;
|
||||
+
|
||||
+ private boolean cancelled = false;
|
||||
|
@ -68,6 +68,13 @@ index 0000000000000000000000000000000000000000..28255dc39eab5faf324d1fe556ab12da
|
|||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @param willDrop If the server is going to drop the block in question with this destroy event
|
||||
+ */
|
||||
+ public void setWillDrop(boolean willDrop) {
|
||||
+ this.willDrop = willDrop;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return If the server is going to play the sound effect for this destruction
|
||||
+ */
|
||||
+ public boolean playEffect() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue