Fix BlockDestroyEvents effectBlock not being set (#10131)

This commit is contained in:
Warrior 2024-01-05 01:09:04 +01:00 committed by GitHub
parent a93acc4275
commit 25a99b12e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -12,18 +12,18 @@ 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..5465f0dc890ad8825b910c2a77fd9c0868115ebe
index 0000000000000000000000000000000000000000..278f26bed374fe79ff3cd135a76f019bd21906e4
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java
@@ -0,0 +1,121 @@
@@ -0,0 +1,123 @@
+package com.destroystokyo.paper.event.block;
+
+import org.bukkit.block.Block;
+import org.bukkit.block.data.BlockData;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockEvent;
+import org.bukkit.event.block.BlockExpEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@ -48,9 +48,11 @@ index 0000000000000000000000000000000000000000..5465f0dc890ad8825b910c2a77fd9c08
+
+ private boolean cancelled = false;
+
+ public BlockDestroyEvent(@NotNull Block block, @NotNull BlockData newState, boolean willDrop) {
+ super(block, 0);
+ @ApiStatus.Internal
+ public BlockDestroyEvent(@NotNull Block block, @NotNull BlockData newState, @NotNull BlockData effectBlock, int xp, boolean willDrop) {
+ super(block, xp);
+ this.newState = newState;
+ this.effectBlock = effectBlock;
+ this.willDrop = willDrop;
+ }
+