Class ProgressBarLayer

java.lang.Object
com.github.darksoulq.abyssallib.world.gui.layer.AbstractBarLayer
com.github.darksoulq.abyssallib.world.gui.layer.ProgressBarLayer
All Implemented Interfaces:
GuiLayer

public class ProgressBarLayer extends AbstractBarLayer
A standard implementation of a multi-slot progress bar.

This class provides public methods to manipulate the progress bar's fill and additional custom metadata strings for shader/model logic.

  • Constructor Details

    • ProgressBarLayer

      public ProgressBarLayer(SlotPosition origin, StructureArray<Item> structure, StructureArray.Orientation orientation, int progressMax)
      Constructs a new ProgressBarLayer.
      Parameters:
      origin - The top-left slot position.
      structure - The item templates for the bar.
      orientation - The direction progress moves (Horizontal/Vertical).
      progressMax - The number of sub-states per item model.
  • Method Details

    • setState

      public void setState(String key, String value)
      Sets a custom state string that will be passed to the item's Custom Model Data.

      The format used in the item strings will be key=value.

      Parameters:
      key - The state key.
      value - The value to assign, or null to remove the key.
    • getState

      public String getState(String key)
      Retrieves the current value of a custom state key.
      Parameters:
      key - The state key.
      Returns:
      The current value, or null if not set.