aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornathannm23 <[email protected]>2024-09-06 14:14:10 -0600
committerGitHub <[email protected]>2024-09-06 22:14:10 +0200
commit953e6e9918784248d70b1c0df867862e2d32468d (patch)
tree7025e8f15e8c962970431a26eb5e60adeadb9510
parent012c52767198360c584f4ce1ac54a0748cdace48 (diff)
downloadPaper-953e6e9918784248d70b1c0df867862e2d32468d.tar.gz
Paper-953e6e9918784248d70b1c0df867862e2d32468d.zip
Fire BlockExpEvent on grindstone use (#11346)
-rw-r--r--patches/server/1056-Fire-BlockExpEvent-on-grindstone-use.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/patches/server/1056-Fire-BlockExpEvent-on-grindstone-use.patch b/patches/server/1056-Fire-BlockExpEvent-on-grindstone-use.patch
new file mode 100644
index 0000000000..58783e8acd
--- /dev/null
+++ b/patches/server/1056-Fire-BlockExpEvent-on-grindstone-use.patch
@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nathan <[email protected]>
+Date: Sat, 31 Aug 2024 18:09:55 -0600
+Subject: [PATCH] Fire BlockExpEvent on grindstone use
+
+
+diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
+index 1678f6c8b2c7db761783e53043169bf12bc2cb29..138f77d13dda574def523d74fa55bc71b5bfa01b 100644
+--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
++++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
+@@ -98,7 +98,11 @@ public class GrindstoneMenu extends AbstractContainerMenu {
+ public void onTake(net.minecraft.world.entity.player.Player player, ItemStack stack) {
+ context.execute((world, blockposition) -> {
+ if (world instanceof ServerLevel) {
+- ExperienceOrb.award((ServerLevel) world, Vec3.atCenterOf(blockposition), this.getExperienceAmount(world), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player); // Paper
++ // Paper start - Fire BlockExpEvent on grindstone use
++ org.bukkit.event.block.BlockExpEvent event = new org.bukkit.event.block.BlockExpEvent(org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition), this.getExperienceAmount(world));
++ event.callEvent();
++ ExperienceOrb.award((ServerLevel) world, Vec3.atCenterOf(blockposition), event.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player);
++ // Paper end - Fire BlockExpEvent on grindstone use
+ }
+
+ world.levelEvent(1042, blockposition, 0);