public boolean checkMissingMaterialTooltip(ItemStack stack, List<String> tooltip, String statIdentifier) { Material material = getMaterial(stack); if(material == Material.UNKNOWN) { NBTTagCompound tag = TagUtil.getTagSafe(stack); String materialID = tag.getString(Tags.PART_MATERIAL); String error; if(!materialID.isEmpty()) { error = I18n.translateToLocalFormatted("tooltip.part.missing_material", materialID); } else { error = I18n.translateToLocal("tooltip.part.missing_info"); } tooltip.addAll(LocUtils.getTooltips(error)); return true; } else if(statIdentifier != null && material.getStats(statIdentifier) == null) { tooltip.addAll(LocUtils.getTooltips(Util.translateFormatted("tooltip.part.missing_stats", material.getLocalizedName(), statIdentifier))); return true; } return false; } }
tooltip.addAll(LocUtils.getTooltips(Util.translateFormatted(desc, items.tagCount()))); tooltip.addAll(LocUtils.getTooltips(Util.translateFormatted("tooltip.chest.has_items", items.tagCount())));
public class ItemTinkerBook extends Item { public ItemTinkerBook() { this.setCreativeTab(TinkerRegistry.tabGeneral); this.setMaxStackSize(1); } @Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack itemStack = playerIn.getHeldItem(handIn); if(worldIn.isRemote) { TinkerBook.INSTANCE.openGui(itemStack); } return new ActionResult<>(EnumActionResult.SUCCESS, itemStack); } @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) { if(I18n.canTranslate(super.getUnlocalizedName(stack) + ".tooltip")) { tooltip.addAll(LocUtils.getTooltips(TextFormatting.GRAY.toString() + LocUtils.translateRecursive(super.getUnlocalizedName(stack) + ".tooltip"))); } } }
tooltip.addAll(LocUtils.getTooltips(Util.translate("item.tconstruct.sharpening_kit.tooltip"))); if(!checkMissingMaterialTooltip(stack, tooltip, MaterialTypes.HEAD)) { Material material = getMaterial(stack);
i = 2; tooltip.addAll(LocUtils.getTooltips(Util.translate(LOC_TOOLTIP + i)));
public static void addOptionalTooltip(ItemStack stack, List<String> tooltip) { if (I18n.canTranslate(stack.getUnlocalizedName() + ".tooltip")) { tooltip.addAll(LocUtils.getTooltips(TextFormatting.GRAY.toString() + LocUtils.translateRecursive(stack.getUnlocalizedName() + ".tooltip"))); } else if (I18n.canTranslate(stack.getUnlocalizedName() + ".tooltip")) { tooltip.addAll(LocUtils.getTooltips(TextFormatting.GRAY.toString() + LocUtils.translateRecursive(stack.getUnlocalizedName() + ".tooltip"))); } }
public static void addOptionalTooltip(ItemStack stack, List<String> tooltip) { if(I18n.canTranslate(stack.getUnlocalizedName() + ".tooltip")) { tooltip.addAll(LocUtils.getTooltips(TextFormatting.GRAY.toString() + LocUtils.translateRecursive(stack.getUnlocalizedName() + ".tooltip"))); } else if(I18n.canTranslate(stack.getUnlocalizedName() + ".tooltip")) { tooltip.addAll(LocUtils.getTooltips( TextFormatting.GRAY.toString() + LocUtils.translateRecursive(stack.getUnlocalizedName() + ".tooltip"))); } } }
public void addInformation(@Nonnull ItemStack stack, @Nullable World worldIn, @Nonnull List<String> tooltip, ITooltipFlag flagIn) { if(I18n.canTranslate(this.getUnlocalizedName(stack) + ".tooltip")) { tooltip.addAll(LocUtils.getTooltips(TextFormatting.GRAY.toString() + LocUtils.translateRecursive(this.getUnlocalizedName(stack) + ".tooltip"))); tooltip.addAll(LocUtils.getTooltips( TextFormatting.GRAY.toString() + LocUtils.translateRecursive(super.getUnlocalizedName(stack) + ".tooltip")));