Class AbstractBarLayer
java.lang.Object
com.github.darksoulq.abyssallib.world.gui.layer.AbstractBarLayer
- All Implemented Interfaces:
GuiLayer
- Direct Known Subclasses:
ProgressBarLayer
An abstract foundation for multi-slot progress bars using Custom Model Data.
This layer manages a "structure" of items across multiple slots. It calculates how
many slots should be "filled" based on a 0-100 percentage and updates individual
item states using a custom model data string property: bar_progress=[state].
-
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves the bar from the GUI and clears cache.voidRecalculates and renders the bar's state to the GUI.voidsetName(net.kyori.adventure.text.Component name) Sets a custom display name for all item segments in the bar.voidsetProgress(float progress) Sets the fill percentage of the bar.
-
Method Details
-
setProgress
public void setProgress(float progress) Sets the fill percentage of the bar.- Parameters:
progress- A float between 0 and 100.
-
setName
public void setName(net.kyori.adventure.text.Component name) Sets a custom display name for all item segments in the bar.- Parameters:
name- The text component to display on hover.
-
renderTo
-
cleanup
-