Moved salvaged material spawn center to center of top face of anvil.

My fix for the central spawn points of various block-based item drops
moved them from the low corner of the block to the center of the block.
In the case of the salvaged materials, this moved the central spawn
point from the low corner of the top face of the anvil block to the
center of the block above the anvil block. This felt unnatural, so the
point has been moved to the center of the top face of the anvil block.
This commit is contained in:
Sid Shakal 2016-03-17 02:06:19 -05:00
parent 2d4cf76825
commit 60bfabb097
2 changed files with 2 additions and 2 deletions

View File

@ -460,7 +460,7 @@ public class PlayerListener implements Listener {
// Make sure the player knows what he's doing when trying to salvage an enchanted item
if (!(heldItem.getEnchantments().size() > 0) || salvageManager.checkConfirmation(true)) {
SkillUtils.handleAbilitySpeedDecrease(player);
salvageManager.handleSalvage(Misc.getBlockCenter(block.getState()), heldItem);
salvageManager.handleSalvage(block.getLocation(), heldItem);
player.updateInventory();
}
}

View File

@ -95,7 +95,7 @@ public class SalvageManager extends SkillManager {
salvageableAmount = Math.max((int) (salvageableAmount * getMaxSalvagePercentage()), 1); // Always get at least something back, if you're capable of salvaging it.
player.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
location.add(0, 1, 0);
location.add(0.5, 1, 0.5);
Map<Enchantment, Integer> enchants = item.getEnchantments();