Class ConditionalTooltip

java.lang.Object
net.dillon.dillonlib.screen.ConditionalTooltip

public class ConditionalTooltip extends Object
Holds two tooltips based on the result of a boolean supplier.
Since:
1.2
See Also:
  • Method Details

    • ofCondition

      public static ConditionalTooltip ofCondition(BooleanSupplier condition, net.minecraft.network.chat.Component trueTooltip, net.minecraft.network.chat.Component falseTooltip)
      Uses a custom condition instead of the widget's active state.
    • of

      public static ConditionalTooltip of(net.minecraft.network.chat.Component trueTooltip, net.minecraft.network.chat.Component falseTooltip)
      Uses the widget's active state as the condition.
    • empty

      public static ConditionalTooltip empty()
      Uses an empty tooltip.
    • ofActive

      public static ConditionalTooltip ofActive(net.minecraft.network.chat.Component trueTooltip)
      Uses a constant active tooltip.
    • getTooltip

      public net.minecraft.network.chat.Component getTooltip(boolean shouldBeActive)
      Returns the tooltip based on the supplied condition.
      Parameters:
      shouldBeActive - the widget's active-state supplier, used when no custom condition was supplied
    • isEmptyOrNullTooltip

      public boolean isEmptyOrNullTooltip(net.minecraft.network.chat.Component tooltip)
      Returns:
      whether the tooltip is empty or null.