Class GuiEnergyBar

All Implemented Interfaces:
BackgroundRender, ElementEvents, GuiParent<GuiEnergyBar>, TooltipHandler<GuiEnergyBar>

public class GuiEnergyBar extends GuiElement<GuiEnergyBar> implements BackgroundRender
Created by brandon3055 on 10/09/2023
  • Field Details

    • COMMA_FORMAT

      public static final DecimalFormat COMMA_FORMAT
    • EMPTY

      public static final Material EMPTY
    • FULL

      public static final Material FULL
  • Constructor Details

    • GuiEnergyBar

      public GuiEnergyBar(@NotNull @NotNull GuiParent<?> parent)
  • Method Details

    • simpleBar

      public static GuiEnergyBar.EnergyBar simpleBar(@NotNull @NotNull GuiParent<?> parent)
      Creates a simple energy bar using a simple slot as a background to make it look nice.
    • defaultFormatter

      public static BiFunction<Long,Long,List<net.minecraft.network.chat.Component>> defaultFormatter()
    • setEmptyTexture

      public GuiEnergyBar setEmptyTexture(Material emptyTexture)
    • setFullTexture

      public GuiEnergyBar setFullTexture(Material fullTexture)
    • setCapacity

      public GuiEnergyBar setCapacity(long capacity)
    • setCapacity

      public GuiEnergyBar setCapacity(Supplier<Long> capacity)
    • setEnergy

      public GuiEnergyBar setEnergy(long energy)
    • setEnergy

      public GuiEnergyBar setEnergy(Supplier<Long> energy)
    • getEnergy

      public long getEnergy()
    • getCapacity

      public long getCapacity()
    • setToolTipFormatter

      public GuiEnergyBar setToolTipFormatter(BiFunction<Long,Long,List<net.minecraft.network.chat.Component>> toolTipFormatter)
      Install a custom formatter to control how the energy tool tip renders.
    • renderBackground

      public void renderBackground(GuiRender render, double mouseX, double mouseY, float partialTicks)
      Description copied from interface: BackgroundRender
      Used to render content behind this elements child elements. When rendering element content, always use the PoseStack available via the provided GuiRender Where applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.
      Specified by:
      renderBackground in interface BackgroundRender
      Parameters:
      render - Contains gui context information as well as essential render methods/utils including the PoseStack.