<commit_before>package net.darkhax.darkutils.addons.baubles;

import baubles.api.BaublesApi;
import net.darkhax.bookshelf.lib.util.ItemStackUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class DarkUtilsBaublesAddon {
    
    public static boolean isPlayerWearingAmulet (EntityPlayer player, Item item) {
        
        return isPlayerWearingBauble(player, item, 0);
    }
    
    /**
     * A simple check to see if a player is wearing a certain item in either ring slot.
     * 
     * @param player: The Player to check.
     * @param item: The Item being looked for.
     * @return bollean: True if the player is wearing the specified item in either ring slot.
     */
    public static boolean isPlayerWearingRing (EntityPlayer player, Item item) {
        
        return isPlayerWearingBauble(player, item, 1) || isPlayerWearingBauble(player, item, 1);
    }
    
    /**
     * A simple check to see if a player is wearing a certain item in their belt slot.
     * 
     * @param player: The Player to check.
     * @param item: The Item being looked for.
     * @return boolean: True if the player is wearing the specified bauble.
     */
    public static boolean isPlayerWearingBelt (EntityPlayer player, Item item) {
        
        return isPlayerWearingBauble(player, item, 3);
    }
    
    /**
     * A check to see if a player is wearing a certain item in a certain bauble slot.
     * 
     * @param player: The Player to check.
     * @param item: The Item being looked for.
     * @param type: The type being looked for. 0 = Amulet, 1 = Ring 1, 2 = Ring 2, 3 = Belt.
     * @return boolean: True if the player is wearing the specified bauble.
     */
    public static boolean isPlayerWearingBauble (EntityPlayer player, Item item, int type) {
        
        IInventory inv = BaublesApi.getBaubles(player);
        
        if (inv != null) {
            
            ItemStack stack = inv.getStackInSlot(type);
            
            return (ItemStackUtils.isValidStack(stack) && stack.getItem() == item);
        }
        
        return false;
    }
}<commit_msg>Made the baubles utils stack sensetive. <commit_after>package net.darkhax.darkutils.addons.baubles;

import baubles.api.BaublesApi;
import net.darkhax.bookshelf.lib.util.ItemStackUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class DarkUtilsBaublesAddon {
    
    public static boolean isPlayerWearingAmulet (EntityPlayer player, ItemStack item) {
        
        return isPlayerWearingBauble(player, item, 0);
    }
    
    /**
     * A simple check to see if a player is wearing a certain item in either ring slot.
     * 
     * @param player: The Player to check.
     * @param item: The Item being looked for.
     * @return bollean: True if the player is wearing the specified item in either ring slot.
     */
    public static boolean isPlayerWearingRing (EntityPlayer player, ItemStack item) {
        
        return isPlayerWearingBauble(player, item, 1) || isPlayerWearingBauble(player, item, 1);
    }
    
    /**
     * A simple check to see if a player is wearing a certain item in their belt slot.
     * 
     * @param player: The Player to check.
     * @param item: The Item being looked for.
     * @return boolean: True if the player is wearing the specified bauble.
     */
    public static boolean isPlayerWearingBelt (EntityPlayer player, ItemStack item) {
        
        return isPlayerWearingBauble(player, item, 3);
    }
    
    /**
     * A check to see if a player is wearing a certain item in a certain bauble slot.
     * 
     * @param player: The Player to check.
     * @param item: The Item being looked for.
     * @param type: The type being looked for. 0 = Amulet, 1 = Ring 1, 2 = Ring 2, 3 = Belt.
     * @return boolean: True if the player is wearing the specified bauble.
     */
    public static boolean isPlayerWearingBauble (EntityPlayer player, ItemStack item, int type) {
        
        IInventory inv = BaublesApi.getBaubles(player);
        
        if (inv != null) {
            
            ItemStack stack = inv.getStackInSlot(type);
            
            return (ItemStackUtils.isValidStack(stack) && ItemStackUtils.areStacksSimilar(stack, item));
        }
        
        return false;
    }
}
{'fraction_non_alphanumeric': 0.0796812749003984, 'fraction_numerical': 0.004426737494466578, 'mean_word_length': 2.5112665112665113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6746516', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1291, 'n_words': 456}