Search in sources :

Example 1 with ShaderWrapper

use of blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper 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)

Example 2 with ShaderWrapper

use of blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper in project ImmersiveEngineering by BluSunrize.

the class ItemChemthrower method shouldCauseReequipAnimation.

@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
    if (slotChanged)
        return true;
    if (oldStack.hasCapability(CapabilityShader.SHADER_CAPABILITY, null) && newStack.hasCapability(CapabilityShader.SHADER_CAPABILITY, null)) {
        ShaderWrapper wrapperOld = oldStack.getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        ShaderWrapper wrapperNew = newStack.getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        if (!ItemStack.areItemStacksEqual(wrapperOld.getShaderItem(), wrapperNew.getShaderItem()))
            return true;
    }
    return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged);
}
Also used : ShaderWrapper(blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper)

Example 3 with ShaderWrapper

use of blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper in project ImmersiveEngineering by BluSunrize.

the class ItemDrill method shouldCauseReequipAnimation.

@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
    if (slotChanged)
        return true;
    if (oldStack.hasCapability(CapabilityShader.SHADER_CAPABILITY, null) && newStack.hasCapability(CapabilityShader.SHADER_CAPABILITY, null)) {
        ShaderWrapper wrapperOld = oldStack.getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        ShaderWrapper wrapperNew = newStack.getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        if (!ItemStack.areItemStacksEqual(wrapperOld.getShaderItem(), wrapperNew.getShaderItem()))
            return true;
    }
    return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged);
}
Also used : ShaderWrapper(blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper)

Example 4 with ShaderWrapper

use of blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper in project ImmersiveEngineering by BluSunrize.

the class ItemRailgun method shouldCauseReequipAnimation.

@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
    if (slotChanged)
        return true;
    if (oldStack.hasCapability(CapabilityShader.SHADER_CAPABILITY, null) && newStack.hasCapability(CapabilityShader.SHADER_CAPABILITY, null)) {
        ShaderWrapper wrapperOld = oldStack.getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        ShaderWrapper wrapperNew = newStack.getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        if (!ItemStack.areItemStacksEqual(wrapperOld.getShaderItem(), wrapperNew.getShaderItem()))
            return true;
    }
    return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged);
}
Also used : ShaderWrapper(blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper)

Example 5 with ShaderWrapper

use of blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper in project ImmersiveEngineering by BluSunrize.

the class ItemRevolver method shouldCauseReequipAnimation.

@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
    if (slotChanged)
        return true;
    if (oldStack.hasCapability(CapabilityShader.SHADER_CAPABILITY, null) && newStack.hasCapability(CapabilityShader.SHADER_CAPABILITY, null)) {
        ShaderWrapper wrapperOld = oldStack.getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        ShaderWrapper wrapperNew = newStack.getCapability(CapabilityShader.SHADER_CAPABILITY, null);
        if (!ItemStack.areItemStacksEqual(wrapperOld.getShaderItem(), wrapperNew.getShaderItem()))
            return true;
    }
    return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged);
}
Also used : ShaderWrapper(blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper)

Aggregations

ShaderWrapper (blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper)8 ItemStack (net.minecraft.item.ItemStack)4 ComparableItemStack (blusunrize.immersiveengineering.api.ComparableItemStack)1 IShaderItem (blusunrize.immersiveengineering.api.shader.IShaderItem)1 ShaderCase (blusunrize.immersiveengineering.api.shader.ShaderCase)1 ShaderLayer (blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer)1 IUpgradeableTool (blusunrize.immersiveengineering.api.tool.IUpgradeableTool)1 GuiBlastFurnace (blusunrize.immersiveengineering.client.gui.GuiBlastFurnace)1 ItemEngineersBlueprint (blusunrize.immersiveengineering.common.items.ItemEngineersBlueprint)1 GuiButtonManual (blusunrize.lib.manual.gui.GuiButtonManual)1 GuiButtonManualNavigation (blusunrize.lib.manual.gui.GuiButtonManualNavigation)1 ArrayList (java.util.ArrayList)1 BakedQuad (net.minecraft.client.renderer.block.model.BakedQuad)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 Slot (net.minecraft.inventory.Slot)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 UnpackedBakedQuad (net.minecraftforge.client.model.pipeline.UnpackedBakedQuad)1 TRSRTransformation (net.minecraftforge.common.model.TRSRTransformation)1 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)1