mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Allow preventing BlockDestroyEvent from dropping items (#8349)
This commit is contained in:
parent
a2df674cc0
commit
2cb0061b0a
2 changed files with 9 additions and 1 deletions
|
@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ private static final HandlerList handlers = new HandlerList();
|
+ private static final HandlerList handlers = new HandlerList();
|
||||||
+
|
+
|
||||||
+ @NotNull private final BlockData newState;
|
+ @NotNull private final BlockData newState;
|
||||||
+ private final boolean willDrop;
|
+ private boolean willDrop;
|
||||||
+ private boolean playEffect = true;
|
+ private boolean playEffect = true;
|
||||||
+
|
+
|
||||||
+ private boolean cancelled = false;
|
+ private boolean cancelled = false;
|
||||||
|
@ -68,6 +68,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
+ * @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
|
+ * @return If the server is going to play the sound effect for this destruction
|
||||||
+ */
|
+ */
|
||||||
+ public boolean playEffect() {
|
+ public boolean playEffect() {
|
||||||
|
|
|
@ -36,6 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ playEffect = event.playEffect();
|
+ playEffect = event.playEffect();
|
||||||
|
+ drop = event.willDrop();
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue