mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Things in inventory can be null.
This commit is contained in:
parent
1b814b937b
commit
615288e635
@ -79,6 +79,10 @@ public class PlayerListener implements Listener {
|
||||
|
||||
if (playerProfile.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) || playerProfile.getAbilityMode(AbilityType.SUPER_BREAKER)) {
|
||||
for (ItemStack item : event.getDrops()) {
|
||||
if (item == null || item.getType() == Material.AIR ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.containsEnchantment(Enchantment.DIG_SPEED)) {
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.gmail.nossr50.skills.utilities;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -545,6 +546,10 @@ public class SkillTools {
|
||||
PlayerInventory playerInventory = player.getInventory();
|
||||
|
||||
for (ItemStack item : playerInventory.getContents()) {
|
||||
if (item == null || item.getType() == Material.AIR ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.containsEnchantment(Enchantment.DIG_SPEED)) {
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user