mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
parent
341dc45202
commit
61388f46f1
@ -129,6 +129,14 @@ public class SalvageManager extends SkillManager {
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack salvageResults = new ItemStack(salvageable.getSalvageMaterial(), lotteryResults);
|
||||
|
||||
//Call event
|
||||
if (EventUtils.callSalvageCheckEvent(player, item, salvageResults, enchantBook).isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We only send a confirmation message after processing the event (fixes #4694)
|
||||
if (lotteryResults == potentialSalvageYield && potentialSalvageYield != 1 && RankUtils.isPlayerMaxRankInSubSkill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE)) {
|
||||
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Perfect", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
} else if (salvageable.getMaximumQuantity() == 1 || getSalvageLimit() >= salvageable.getMaximumQuantity()) {
|
||||
@ -137,13 +145,6 @@ public class SalvageManager extends SkillManager {
|
||||
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||
}
|
||||
|
||||
ItemStack salvageResults = new ItemStack(salvageable.getSalvageMaterial(), lotteryResults);
|
||||
|
||||
//Call event
|
||||
if (EventUtils.callSalvageCheckEvent(player, item, salvageResults, enchantBook).isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
|
||||
|
||||
Location anvilLoc = location.clone();
|
||||
|
Loading…
Reference in New Issue
Block a user