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));
}
}
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);
}
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);
}
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);
}
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);
}
Aggregations