Merge pull request #4235 from kn-km/patch-1

Fix McMMOPlayerSalvageCheckEvent Handling
This commit is contained in:
Robert Alan Chapton 2020-07-31 20:43:44 -07:00 committed by GitHub
commit 7828437414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,7 +100,6 @@ public class SalvageManager extends SkillManager {
potentialSalvageYield = Math.min(potentialSalvageYield, getSalvageLimit()); // Always get at least something back, if you're capable of salvaging it.
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
location.add(0.5, 1, 0.5);
Map<Enchantment, Integer> enchants = item.getEnchantments();
@ -140,6 +139,8 @@ public class SalvageManager extends SkillManager {
return;
}
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
Location anvilLoc = location.clone();
Location playerLoc = player.getLocation().clone();
double distance = anvilLoc.distance(playerLoc);