Search in sources :

Example 1 with GuiBlastFurnace

use of blusunrize.immersiveengineering.client.gui.GuiBlastFurnace in project ImmersiveEngineering by BluSunrize.

the class ClientEventHandler method onItemTooltip.

@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent event) {
    if (event.getItemStack().hasCapability(CapabilityShader.SHADER_CAPABILITY, null)) {
        ShaderWrapper wrapper = event.getItemStack().getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        ItemStack shader = wrapper != null ? wrapper.getShaderItem() : null;
        if (shader != null)
            event.getToolTip().add(TextFormatting.DARK_GRAY + shader.getDisplayName());
    }
    if (ItemNBTHelper.hasKey(event.getItemStack(), "IE:Earmuffs")) {
        ItemStack earmuffs = ItemNBTHelper.getItemStack(event.getItemStack(), "IE:Earmuffs");
        if (earmuffs != null)
            event.getToolTip().add(TextFormatting.GRAY + earmuffs.getDisplayName());
    }
    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT && ClientUtils.mc().currentScreen != null && ClientUtils.mc().currentScreen instanceof GuiBlastFurnace && BlastFurnaceRecipe.isValidBlastFuel(event.getItemStack()))
        event.getToolTip().add(TextFormatting.GRAY + I18n.format("desc.ImmersiveEngineering.info.blastFuelTime", BlastFurnaceRecipe.getBlastFuelTime(event.getItemStack())));
    if (IEConfig.oreTooltips && event.isShowAdvancedItemTooltips()) {
        for (int oid : OreDictionary.getOreIDs(event.getItemStack())) event.getToolTip().add(TextFormatting.GRAY + OreDictionary.getOreName(oid));
    //			FluidStack fs = FluidUtil.getFluidContained(event.getItemStack());
    //			if(fs!=null && fs.getFluid()!=null)
    //				event.getToolTip().add("Fluid: "+ FluidRegistry.getFluidName(fs));
    }
}
Also used : GuiBlastFurnace(blusunrize.immersiveengineering.client.gui.GuiBlastFurnace) ShaderWrapper(blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper) ItemStack(net.minecraft.item.ItemStack) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

ShaderWrapper (blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper)1 GuiBlastFurnace (blusunrize.immersiveengineering.client.gui.GuiBlastFurnace)1 ItemStack (net.minecraft.item.ItemStack)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1