Class TooltipHelper

java.lang.Object
com.simibubi.create.foundation.item.TooltipHelper

public class TooltipHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static com.mojang.bridge.game.Language
     
    static final Map<String,ItemDescription>
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addHint(List<net.minecraft.network.chat.Component> tooltip, String hintKey, Object... messageParams)
     
    static List<String>
    cutString(String s, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor, int indent)
    Deprecated.
    static List<String>
    cutString(net.minecraft.network.chat.Component s, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor)
    Deprecated.
    static List<net.minecraft.network.chat.Component>
    cutStringTextComponent(String c, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor)
     
    static List<net.minecraft.network.chat.Component>
    cutStringTextComponent(String c, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor, int indent)
     
    static List<net.minecraft.network.chat.Component>
    cutTextComponent(net.minecraft.network.chat.Component c, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor)
     
    static List<net.minecraft.network.chat.Component>
    cutTextComponent(net.minecraft.network.chat.Component c, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor, int indent)
     
    getTooltip(net.minecraft.world.item.ItemStack stack)
     
    static String
    getTooltipTranslationKey(net.minecraft.world.item.ItemStack stack)
     
    static boolean
    hasTooltip(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player)
     
    static net.minecraft.network.chat.MutableComponent
    holdShift(ItemDescription.Palette color, boolean highlighted)
     
    static void
    referTo(net.minecraft.world.level.ItemLike item, String string)
     
    static void
    referTo(net.minecraft.world.level.ItemLike item, Supplier<? extends net.minecraft.world.level.ItemLike> itemWithTooltip)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • maxWidthPerLine

      public static final int maxWidthPerLine
      See Also:
    • cachedTooltips

      public static final Map<String,ItemDescription> cachedTooltips
    • cachedLanguage

      public static com.mojang.bridge.game.Language cachedLanguage
  • Constructor Details

    • TooltipHelper

      public TooltipHelper()
  • Method Details

    • holdShift

      public static net.minecraft.network.chat.MutableComponent holdShift(ItemDescription.Palette color, boolean highlighted)
    • addHint

      public static void addHint(List<net.minecraft.network.chat.Component> tooltip, String hintKey, Object... messageParams)
    • referTo

      public static void referTo(net.minecraft.world.level.ItemLike item, Supplier<? extends net.minecraft.world.level.ItemLike> itemWithTooltip)
    • referTo

      public static void referTo(net.minecraft.world.level.ItemLike item, String string)
    • cutString

      @Deprecated public static List<String> cutString(net.minecraft.network.chat.Component s, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor)
      Deprecated.
    • cutString

      @Deprecated public static List<String> cutString(String s, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor, int indent)
      Deprecated.
    • cutStringTextComponent

      public static List<net.minecraft.network.chat.Component> cutStringTextComponent(String c, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor)
    • cutTextComponent

      public static List<net.minecraft.network.chat.Component> cutTextComponent(net.minecraft.network.chat.Component c, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor)
    • cutStringTextComponent

      public static List<net.minecraft.network.chat.Component> cutStringTextComponent(String c, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor, int indent)
    • cutTextComponent

      public static List<net.minecraft.network.chat.Component> cutTextComponent(net.minecraft.network.chat.Component c, net.minecraft.ChatFormatting defaultColor, net.minecraft.ChatFormatting highlightColor, int indent)
    • hasTooltip

      public static boolean hasTooltip(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player)
    • getTooltip

      public static ItemDescription getTooltip(net.minecraft.world.item.ItemStack stack)
    • getTooltipTranslationKey

      public static String getTooltipTranslationKey(net.minecraft.world.item.ItemStack stack)