From 3211d5268518350417a29f40768a6c553fce2401 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 6 May 2012 21:38:01 -0600 Subject: [PATCH] Fire PlayerItemBreakEvent. Addresses BUKKIT-1600 By: Travis Ralston --- .../org/bukkit/craftbukkit/event/CraftEventFactory.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 79ad5256e8..ffd5b4422e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -526,4 +526,10 @@ public class CraftEventFactory { world.getServer().getPluginManager().callEvent(event); return event; } + + public static void callPlayerItemBreakEvent(EntityHuman human, ItemStack brokenItem) { + CraftItemStack item = new CraftItemStack(brokenItem); + PlayerItemBreakEvent event = new PlayerItemBreakEvent((Player) human.getBukkitEntity(), item); + Bukkit.getPluginManager().callEvent(event); + } }