Paper/Spigot-API-Patches/0142-Add-source-block-to-BlockPhysicsEvent.patch
Shane Freeder 0976d52bbd Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Please note that this build includes changes to meet upstreams
requirements for nullability annotations. While we aim for a level of
accuracy, these might not be 100% correct, if there are any issues,
please speak to us on discord, or open an issue on the tracker to
discuss.

Bukkit Changes:
9a6a1de3 Remove nullability annotations from enum constructors
3f0591ea SPIGOT-2540: Add nullability annotations to entire Bukkit API

CraftBukkit Changes:
8d8475fc SPIGOT-4666: Force parameter in HumanEntity#sleep
8b1588e2 Fix ExplosionPrimeEvent#setFire not working with EnderCrystals
39a287b7 Don't ignore newlines in PlayerListHeader/Footer

Spigot Changes:
cf694d87 Add nullability annotations
2019-03-20 00:31:18 +00:00

28 lines
1.1 KiB
Diff

From f8d3b059dcc85e1cb314e19265591247f9f2eb2f Mon Sep 17 00:00:00 2001
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
index 75d4e70f5..a28731dc2 100644
--- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
+++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
@@ -32,6 +32,13 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
private final Block sourceBlock;
private boolean cancel = false;
+ // Paper start - Legacy constructor, use #BlockPhysicsEvent(Block, BlockData, Block)
+ @Deprecated
+ public BlockPhysicsEvent(final Block block, final BlockData changed, final int sourceX, final int sourceY, final int sourceZ) {
+ this(block, changed, block.getWorld().getBlockAt(sourceX, sourceY, sourceZ));
+ }
+ // Paper end
+
public BlockPhysicsEvent(@NotNull final Block block, @NotNull final BlockData changed) {
this(block, changed, block);
}
--
2.21.0