aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0548-Add-PrepareGrindstoneEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches/0548-Add-PrepareGrindstoneEvent.patch')
-rw-r--r--Spigot-Server-Patches/0548-Add-PrepareGrindstoneEvent.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0548-Add-PrepareGrindstoneEvent.patch b/Spigot-Server-Patches/0548-Add-PrepareGrindstoneEvent.patch
new file mode 100644
index 0000000000..f0a00ab8ed
--- /dev/null
+++ b/Spigot-Server-Patches/0548-Add-PrepareGrindstoneEvent.patch
@@ -0,0 +1,33 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jan Tuck <[email protected]>
+Date: Sat, 20 Jun 2020 22:34:20 +0200
+Subject: [PATCH] Add PrepareGrindstoneEvent
+
+
+diff --git a/src/main/java/net/minecraft/server/ContainerGrindstone.java b/src/main/java/net/minecraft/server/ContainerGrindstone.java
+index ed88e208d00f3b19b5c5916cf87513ab511a5fb1..83cb0cd64c81eb35fa49eecff93b40f08e0a5606 100644
+--- a/src/main/java/net/minecraft/server/ContainerGrindstone.java
++++ b/src/main/java/net/minecraft/server/ContainerGrindstone.java
+@@ -10,6 +10,10 @@ import org.bukkit.craftbukkit.inventory.CraftInventoryGrindstone;
+ import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+ import org.bukkit.entity.Player;
+ // CraftBukkit end
++// Paper start
++import org.bukkit.craftbukkit.inventory.CraftItemStack;
++import com.destroystokyo.paper.event.inventory.PrepareGrindstoneEvent;
++// Paper end
+
+ public class ContainerGrindstone extends Container {
+
+@@ -144,6 +148,11 @@ public class ContainerGrindstone extends Container {
+ super.a(iinventory);
+ if (iinventory == this.craftInventory) {
+ this.e();
++ // Paper start
++ PrepareGrindstoneEvent event = new PrepareGrindstoneEvent(this.getBukkitView(), CraftItemStack.asBukkitCopy(this.resultInventory.getItem(0)));
++ event.callEvent();
++ this.resultInventory.setItem(0, CraftItemStack.asNMSCopy(event.getResult()));
++ // Paper end
+ }
+
+ }