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"))); } } }
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) { if(I18n.canTranslate(this.getUnlocalizedName(stack) + ".tooltip")) { tooltip.add(TextFormatting.GRAY.toString() + LocUtils.translateRecursive(this.getUnlocalizedName(stack) + ".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 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"))); } } }
if(I18n.canTranslate(this.getUnlocalizedName(stack) + ".tooltip")) { tooltip.addAll(LocUtils.getTooltips(TextFormatting.GRAY.toString() + LocUtils.translateRecursive(this.getUnlocalizedName(stack) + ".tooltip"))); TextFormatting.GRAY.toString() + LocUtils.translateRecursive(super.getUnlocalizedName(stack) + ".tooltip")));