mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Take a player, not an item. Also avoids potential for NPE.
This commit is contained in:
parent
4071f259ad
commit
6f96a5026b
@ -439,7 +439,7 @@ public class SkillTools {
|
|||||||
player.setCanPickupItems(false);
|
player.setCanPickupItems(false);
|
||||||
}
|
}
|
||||||
else if (ability == AbilityType.SUPER_BREAKER || ability == AbilityType.GIGA_DRILL_BREAKER) {
|
else if (ability == AbilityType.SUPER_BREAKER || ability == AbilityType.GIGA_DRILL_BREAKER) {
|
||||||
handleAbilitySpeedIncrease(player.getItemInHand());
|
handleAbilitySpeedIncrease(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -524,7 +524,13 @@ public class SkillTools {
|
|||||||
return skillLevel;
|
return skillLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void handleAbilitySpeedIncrease(ItemStack heldItem) {
|
public static void handleAbilitySpeedIncrease(Player player) {
|
||||||
|
ItemStack heldItem = player.getItemInHand();
|
||||||
|
|
||||||
|
if (heldItem == null || heldItem.getType() == Material.AIR ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int efficiencyLevel = heldItem.getEnchantmentLevel(Enchantment.DIG_SPEED);
|
int efficiencyLevel = heldItem.getEnchantmentLevel(Enchantment.DIG_SPEED);
|
||||||
ItemMeta itemMeta = heldItem.getItemMeta();
|
ItemMeta itemMeta = heldItem.getItemMeta();
|
||||||
List<String> itemLore = new ArrayList<String>();
|
List<String> itemLore = new ArrayList<String>();
|
||||||
|
Loading…
Reference in New Issue
Block a user