diff options
author | Senmori <thesenmori@gmail.com> | 2017-11-21 10:17:31 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-11-21 10:21:20 +1100 |
commit | bdb88226252f029f6b752c0a83740eb74f7a4ba8 (patch) | |
tree | dc6aa5ebc379815bcfc76b3c7188aab72bc95b05 /src/main | |
parent | 19ed80cef7d8ff85a368bd8459c1d91ef0149f61 (diff) | |
download | craftbukkit-bdb88226252f029f6b752c0a83740eb74f7a4ba8.tar craftbukkit-bdb88226252f029f6b752c0a83740eb74f7a4ba8.tar.gz craftbukkit-bdb88226252f029f6b752c0a83740eb74f7a4ba8.tar.lz craftbukkit-bdb88226252f029f6b752c0a83740eb74f7a4ba8.tar.xz craftbukkit-bdb88226252f029f6b752c0a83740eb74f7a4ba8.zip |
SPIGOT-1505: PlayerItemMendEvent
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 1f8f580f..a8c09481 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -36,6 +36,7 @@ import org.bukkit.entity.AreaEffectCloud; import org.bukkit.entity.Arrow; import org.bukkit.entity.Creeper; import org.bukkit.entity.EntityType; +import org.bukkit.entity.ExperienceOrb; import org.bukkit.entity.Firework; import org.bukkit.entity.LightningStrike; import org.bukkit.entity.LivingEntity; @@ -647,6 +648,14 @@ public class CraftEventFactory { return event; } + public static PlayerItemMendEvent callPlayerItemMendEvent(EntityHuman entity, EntityExperienceOrb orb, net.minecraft.server.ItemStack nmsMendedItem, int repairAmount) { + Player player = (Player) entity.getBukkitEntity(); + org.bukkit.inventory.ItemStack bukkitStack = CraftItemStack.asCraftMirror(nmsMendedItem); + PlayerItemMendEvent event = new PlayerItemMendEvent(player, bukkitStack, (ExperienceOrb) orb.getBukkitEntity(), repairAmount); + Bukkit.getPluginManager().callEvent(event); + return event; + } + public static boolean handleBlockGrowEvent(World world, int x, int y, int z, net.minecraft.server.Block type, int data) { Block block = world.getWorld().getBlockAt(x, y, z); CraftBlockState state = (CraftBlockState) block.getState(); |