mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-04 05:25:28 +02:00
Fix Ender Pearls not preventing XP gains in offhand
This commit is contained in:
@@ -6,6 +6,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.FurnaceRecipe;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
@@ -32,6 +33,10 @@ public final class ItemUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasItemInEitherHand(Player player, Material material) {
|
||||
return player.getInventory().getItemInMainHand().getType() == material || player.getInventory().getItemInOffHand().getType() == material;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the item is a sword.
|
||||
*
|
||||
|
Reference in New Issue
Block a user