Paper/Spigot-API-Patches/0142-Add-source-block-to-BlockPhysicsEvent.patch
Zach Brown 70ce6ce831
Move version command update checking to the implementation
This makes it easier for downstream projects (forks) to replace the
version fetching system with their own. It is as simple as implementing
an interface and overriding the default implementation of
org.bukkit.UnsafeValues#getVersionFetcher()

It also makes it easier for us to organize things like the version
history feature.

Lastly I have updated the paper implementation to check against the site
API rather than against jenkins.
2019-05-27 04:13:41 -05:00

28 lines
1.1 KiB
Diff

From 76457191674e513142d7e2e289b018cafe854e85 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 e3a5f582..c382f9fc 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