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