2020-01-22 02:02:07 +00:00
|
|
|
From f19f62a22ecc44d92b5f0e3e2e85b40e686e3a44 Mon Sep 17 00:00:00 2001
|
2018-08-24 14:38:31 +00:00
|
|
|
From: Sotr <i@omc.hk>
|
|
|
|
Date: Thu, 23 Aug 2018 16:14:25 +0800
|
|
|
|
Subject: [PATCH] Add source block to BlockPhysicsEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
|
2020-01-22 02:02:07 +00:00
|
|
|
index e3a5f582..c382f9fc 100644
|
2018-08-24 14:38:31 +00:00
|
|
|
--- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
|
|
|
|
+++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
|
2019-03-20 00:28:15 +00:00
|
|
|
@@ -32,6 +32,13 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
|
2019-02-25 09:39:24 +00:00
|
|
|
private final Block sourceBlock;
|
2018-08-24 14:38:31 +00:00
|
|
|
private boolean cancel = false;
|
2019-02-25 09:39:24 +00:00
|
|
|
|
|
|
|
+ // Paper start - Legacy constructor, use #BlockPhysicsEvent(Block, BlockData, Block)
|
|
|
|
+ @Deprecated
|
2018-08-24 15:57:11 +00:00
|
|
|
+ public BlockPhysicsEvent(final Block block, final BlockData changed, final int sourceX, final int sourceY, final int sourceZ) {
|
2019-02-25 09:39:24 +00:00
|
|
|
+ this(block, changed, block.getWorld().getBlockAt(sourceX, sourceY, sourceZ));
|
2018-08-24 14:38:31 +00:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2019-02-25 09:39:24 +00:00
|
|
|
+
|
2019-03-20 00:28:15 +00:00
|
|
|
public BlockPhysicsEvent(@NotNull final Block block, @NotNull final BlockData changed) {
|
2019-02-25 09:39:24 +00:00
|
|
|
this(block, changed, block);
|
2018-08-24 14:38:31 +00:00
|
|
|
}
|
|
|
|
--
|
2020-01-22 02:02:07 +00:00
|
|
|
2.25.0.windows.1
|
2018-08-24 14:38:31 +00:00
|
|
|
|