mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 06:06:45 +01:00
Forgot to call mend event before checking its state
This commit is contained in:
parent
beea47cee2
commit
8a3e6b74ba
@ -260,6 +260,7 @@ public final class SkillUtils {
|
|||||||
ExperienceOrb auxOrb = (ExperienceOrb) player.getWorld().spawnEntity(player.getLocation(), EntityType.EXPERIENCE_ORB);
|
ExperienceOrb auxOrb = (ExperienceOrb) player.getWorld().spawnEntity(player.getLocation(), EntityType.EXPERIENCE_ORB);
|
||||||
auxOrb.setExperience(damage / 2);
|
auxOrb.setExperience(damage / 2);
|
||||||
PlayerItemMendEvent event = new PlayerItemMendEvent(player, itemStack, itemStack.getType().getEquipmentSlot(), auxOrb, damage);
|
PlayerItemMendEvent event = new PlayerItemMendEvent(player, itemStack, itemStack.getType().getEquipmentSlot(), auxOrb, damage);
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled() && event.getRepairAmount() != 0) {
|
if (!event.isCancelled() && event.getRepairAmount() != 0) {
|
||||||
itemStack.setDurability((short) (itemStack.getDurability() - event.getRepairAmount()));
|
itemStack.setDurability((short) (itemStack.getDurability() - event.getRepairAmount()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user