Search in sources :

Example 1 with TextFormatting

use of net.minecraft.util.text.TextFormatting in project ImmersiveEngineering by BluSunrize.

the class ItemJerrycan method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
    FluidStack fs = FluidUtil.getFluidContained(stack);
    if (fs != null) {
        TextFormatting rarity = fs.getFluid().getRarity() == EnumRarity.COMMON ? TextFormatting.GRAY : fs.getFluid().getRarity().rarityColor;
        list.add(rarity + fs.getLocalizedName() + TextFormatting.GRAY + ": " + fs.amount + "/" + 10000 + "mB");
    } else
        list.add(I18n.format(Lib.DESC_FLAVOUR + "drill.empty"));
}
Also used : FluidStack(net.minecraftforge.fluids.FluidStack) TextFormatting(net.minecraft.util.text.TextFormatting) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with TextFormatting

use of net.minecraft.util.text.TextFormatting in project ImmersiveEngineering by BluSunrize.

the class ItemChemthrower method addInformation.

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
    FluidStack fs = getFluid(stack);
    if (fs != null) {
        TextFormatting rarity = fs.getFluid().getRarity() == EnumRarity.COMMON ? TextFormatting.GRAY : fs.getFluid().getRarity().rarityColor;
        list.add(rarity + fs.getLocalizedName() + TextFormatting.GRAY + ": " + fs.amount + "/" + getCapacity(stack, 2000) + "mB");
    } else
        list.add(I18n.format(Lib.DESC_FLAVOUR + "drill.empty"));
}
Also used : FluidStack(net.minecraftforge.fluids.FluidStack) TextFormatting(net.minecraft.util.text.TextFormatting)

Aggregations

TextFormatting (net.minecraft.util.text.TextFormatting)2 FluidStack (net.minecraftforge.fluids.FluidStack)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1