This commit is contained in:
TheBusyBiscuit 2021-12-27 18:27:13 +01:00 committed by GitHub
parent 341dc45202
commit 61388f46f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,14 +129,6 @@ public class SalvageManager extends SkillManager {
} }
} }
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()) {
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Normal", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
} else {
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
}
ItemStack salvageResults = new ItemStack(salvageable.getSalvageMaterial(), lotteryResults); ItemStack salvageResults = new ItemStack(salvageable.getSalvageMaterial(), lotteryResults);
//Call event //Call event
@ -144,6 +136,15 @@ public class SalvageManager extends SkillManager {
return; 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()) {
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Normal", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
} else {
NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
}
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR)); player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
Location anvilLoc = location.clone(); Location anvilLoc = location.clone();