Class ManaBarTooltip

java.lang.Object
vazkii.botania.api.mana.ManaBarTooltip
All Implemented Interfaces:
net.minecraft.world.inventory.tooltip.TooltipComponent

public class ManaBarTooltip extends Object implements net.minecraft.world.inventory.tooltip.TooltipComponent
Items with this tooltip component will render a mana bar above the tooltip.
  • Constructor Details

    • ManaBarTooltip

      public ManaBarTooltip(float percentageFull)
    • ManaBarTooltip

      public ManaBarTooltip(float percentageFull, int pickLevel)
      Used for terra shatterer, for level names displayed next to the bar
  • Method Details

    • fromManaItem

      public static ManaBarTooltip fromManaItem(net.minecraft.world.item.ItemStack stack)
      Constructs a tooltip component directly from a stack of mana items.
      Throws:
      IllegalArgumentException - if the item does not have the ManaItem capability.
    • getFractionForDisplay

      public static float getFractionForDisplay(ManaItem item)
      Convenience method to calculate how full is the mana storing item.
    • getPercentageFull

      public float getPercentageFull()
    • getPickLevel

      public int getPickLevel()