aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0892-Add-BlockFace-to-BlockDamageEvent.patch
diff options
context:
space:
mode:
authorJason Penilla <[email protected]>2024-04-27 13:27:01 -0700
committerJason Penilla <[email protected]>2024-04-27 13:27:01 -0700
commite2552eea2481871c9d8445a3c5653a2329112648 (patch)
tree727c90f395576b66200f8d9e59f38859f3850562 /patches/server/0892-Add-BlockFace-to-BlockDamageEvent.patch
parent0b1b1fe067444c5e879313e017da0ffd5d6b826d (diff)
downloadPaper-e2552eea2481871c9d8445a3c5653a2329112648.tar.gz
Paper-e2552eea2481871c9d8445a3c5653a2329112648.zip
Start cleaning up plugin remapping patches
Diffstat (limited to 'patches/server/0892-Add-BlockFace-to-BlockDamageEvent.patch')
-rw-r--r--patches/server/0892-Add-BlockFace-to-BlockDamageEvent.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patches/server/0892-Add-BlockFace-to-BlockDamageEvent.patch b/patches/server/0892-Add-BlockFace-to-BlockDamageEvent.patch
new file mode 100644
index 0000000000..3af304961a
--- /dev/null
+++ b/patches/server/0892-Add-BlockFace-to-BlockDamageEvent.patch
@@ -0,0 +1,39 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: aerulion <[email protected]>
+Date: Mon, 21 Aug 2023 04:36:07 +0200
+Subject: [PATCH] Add BlockFace to BlockDamageEvent
+
+
+diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+index 7b4426ac0435d3f419d9ece29dc9eccdb8f99950..cef3a64b5e6c4d34ed079078420078a7adfcd574 100644
+--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
++++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+@@ -256,7 +256,7 @@ public class ServerPlayerGameMode {
+ }
+ return;
+ }
+- org.bukkit.event.block.BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.player, pos, this.player.getInventory().getSelected(), f >= 1.0f);
++ org.bukkit.event.block.BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.player, pos, direction, this.player.getInventory().getSelected(), f >= 1.0f); // Paper - Add BlockFace to BlockDamageEvent
+
+ if (blockEvent.isCancelled()) {
+ // Let the client know the block still exists
+diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+index 5af62603415865068ca4b79a7e68d8eb813596b1..47a02b7786d284370d8019b07b8d85f895dc280a 100644
+--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+@@ -650,13 +650,13 @@ public class CraftEventFactory {
+ /**
+ * BlockDamageEvent
+ */
+- public static BlockDamageEvent callBlockDamageEvent(ServerPlayer who, BlockPos pos, ItemStack itemstack, boolean instaBreak) {
++ public static BlockDamageEvent callBlockDamageEvent(ServerPlayer who, BlockPos pos, Direction direction, ItemStack itemstack, boolean instaBreak) { // Paper - Add BlockFace to BlockDamageEvent
+ Player player = who.getBukkitEntity();
+ CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack);
+
+ Block blockClicked = CraftBlock.at(who.level(), pos);
+
+- BlockDamageEvent event = new BlockDamageEvent(player, blockClicked, itemInHand, instaBreak);
++ BlockDamageEvent event = new BlockDamageEvent(player, blockClicked, CraftBlock.notchToBlockFace(direction), itemInHand, instaBreak); // Paper - Add BlockFace to BlockDamageEvent
+ player.getServer().getPluginManager().callEvent(event);
+
+ return event;