Search in sources :

Example 6 with UniqueIdentifier

use of cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier in project NewHorizonsCoreMod by GTNewHorizons.

the class CustomFuels method FindFuelValue.

public FuelItem FindFuelValue(ItemStack pItem) {
    try {
        Init();
        if (pItem == null)
            return null;
        UniqueIdentifier UID = GameRegistry.findUniqueIdentifierFor(pItem.getItem());
        String tCompareName = UID.toString();
        if (pItem.getItemDamage() > 0)
            tCompareName = String.format("%s:%d", tCompareName, pItem.getItemDamage());
        for (FuelItem ifi : mFuelItems) {
            if (ifi.mItemName.equalsIgnoreCase(tCompareName))
                return ifi;
        }
        return null;
    } catch (Exception e) {
        return null;
    }
}
Also used : UniqueIdentifier(cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier)

Aggregations

UniqueIdentifier (cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier)6 HazardousFluid (com.dreammaster.modhazardousitems.HazardousItems.HazardousFluid)1 HazardousItem (com.dreammaster.modhazardousitems.HazardousItems.HazardousItem)1 DataOutputStream (java.io.DataOutputStream)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 Block (net.minecraft.block.Block)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1