Package vazkii.botania.api.mana
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 Summary
ConstructorsConstructorDescriptionManaBarTooltip(float percentageFull) ManaBarTooltip(float percentageFull, int pickLevel) Used for terra shatterer, for level names displayed next to the bar -
Method Summary
Modifier and TypeMethodDescriptionstatic ManaBarTooltipfromManaItem(net.minecraft.world.item.ItemStack stack) Constructs a tooltip component directly from a stack of mana items.static floatgetFractionForDisplay(@Nullable ManaItem item) Convenience method to calculate how full is the mana storing item.floatint
-
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
Constructs a tooltip component directly from a stack of mana items.- Throws:
IllegalArgumentException- if the item does not have theManaItemcapability.
-
getFractionForDisplay
Convenience method to calculate how full is the mana storing item. -
getPercentageFull
public float getPercentageFull() -
getPickLevel
public int getPickLevel()
-