Search in sources :

Example 11 with OrePrefix

use of gregtech.api.unification.ore.OrePrefix in project GregTech by GregTechCE.

the class MetaItem1 method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, @Nullable World world, List<String> lines, ITooltipFlag tooltipFlag) {
    super.addInformation(itemStack, world, lines, tooltipFlag);
    int damage = itemStack.getItemDamage();
    if (damage < this.metaItemOffset && damage >= 0) {
        Material material = Material.MATERIAL_REGISTRY.getObjectById(damage % 1000);
        if (material != null) {
            OrePrefix prefix = this.orePrefixes[(damage / 1000)];
            if (prefix == OrePrefix.dustImpure || prefix == OrePrefix.dustPure) {
                lines.add(I18n.format("metaitem.dust.tooltip.purify"));
            }
        }
    }
}
Also used : OrePrefix(gregtech.api.unification.ore.OrePrefix) Material(gregtech.api.unification.material.type.Material) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

OrePrefix (gregtech.api.unification.ore.OrePrefix)11 Material (gregtech.api.unification.material.type.Material)9 MarkerMaterial (gregtech.api.unification.material.type.MarkerMaterial)5 ItemStack (net.minecraft.item.ItemStack)4 GemMaterial (gregtech.api.unification.material.type.GemMaterial)3 SimpleItemStack (gregtech.api.unification.stack.SimpleItemStack)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 CaseFormat (com.google.common.base.CaseFormat)2 Joiner (com.google.common.base.Joiner)2 ImmutableList (com.google.common.collect.ImmutableList)2 M (gregtech.api.GTValues.M)2 DustMaterial (gregtech.api.unification.material.type.DustMaterial)2 MetalMaterial (gregtech.api.unification.material.type.MetalMaterial)2 ItemMaterialInfo (gregtech.api.unification.stack.ItemMaterialInfo)2 MaterialStack (gregtech.api.unification.stack.MaterialStack)2 UnificationEntry (gregtech.api.unification.stack.UnificationEntry)2 java.util (java.util)2 Nullable (javax.annotation.Nullable)2 MinecraftForge (net.minecraftforge.common.MinecraftForge)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2