Quick fix damage event

This commit is contained in:
md-5 2013-03-05 07:22:03 +11:00
parent 2faef00909
commit 6a61d27c10

View File

@ -19,7 +19,7 @@ index 3043db9..8925327 100644
+ // Spigot start
+ if (entityliving instanceof EntityPlayer) {
+ org.bukkit.craftbukkit.inventory.CraftItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this);
+ org.bukkit.event.player.PlayerItemDamageEvent event = new org.bukkit.event.player.PlayerItemDamageEvent((org.bukkit.entity.Player) entityliving.getBukkitEntity(), item, damage);
+ org.bukkit.event.player.PlayerItemDamageEvent event = new org.bukkit.event.player.PlayerItemDamageEvent((org.bukkit.entity.Player) entityliving.getBukkitEntity(), item, i);
+ org.bukkit.Bukkit.getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) return;
+ i = event.getDamage();