Class GuiEnergyBar
java.lang.Object
codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry<GuiEnergyBar>
codechicken.lib.gui.modular.elements.GuiElement<GuiEnergyBar>
codechicken.lib.gui.modular.elements.GuiEnergyBar
- All Implemented Interfaces:
BackgroundRender,ElementEvents,GuiParent<GuiEnergyBar>,TooltipHandler<GuiEnergyBar>
Created by brandon3055 on 10/09/2023
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DecimalFormatstatic final Materialstatic final MaterialFields inherited from class codechicken.lib.gui.modular.elements.GuiElement
hoverTime, initialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BiFunction<Long, Long, List<net.minecraft.network.chat.Component>> longlongvoidrenderBackground(GuiRender render, double mouseX, double mouseY, float partialTicks) Used to render content behind this elements child elements.setCapacity(long capacity) setCapacity(Supplier<Long> capacity) setEmptyTexture(Material emptyTexture) setEnergy(long energy) setFullTexture(Material fullTexture) setToolTipFormatter(BiFunction<Long, Long, List<net.minecraft.network.chat.Component>> toolTipFormatter) Install a custom formatter to control how the energy tool tip renders.static GuiEnergyBar.EnergyBarCreates a simple energy bar using a simple slot as a background to make it look nice.Methods inherited from class codechicken.lib.gui.modular.elements.GuiElement
addChild, addJeiDropTargets, addJeiExclusions, adoptChild, applyQueuedChildUpdates, blockMouseEvents, blockMouseOver, bringChildToForeground, font, getChildren, getCombinedElementDepth, getJeiDropConsumer, getModularGui, getParent, getTooltip, getTooltipDelay, hoverTime, initElement, isDescendantOf, isEnabled, isJeiDropTarget, isJeiExcluded, isMouseOver, isOpaque, isRemoved, isTooltipEnabled, jeiExclude, mc, onScreenInit, removeChild, render, renderChild, renderOverlay, scaledScreenHeight, scaledScreenWidth, sendChildToBackground, sendChildToIndex, setEnabled, setEnabled, setEnableToolTip, setJeiDropTarget, setJeiExcluded, setOpaque, setRenderCull, setTooltip, setTooltipDelay, setZStacking, showToolTip, tick, toString, updateMouseOver, updateScreenData, zStackingMethods inherited from class codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry
addBoundsToRect, clearConstraints, clearGeometryCache, constrain, get, getChildBounds, getEnclosingRect, getParent, getPosition, getRectangle, placeInside, placeInside, placeOutside, placeOutside, setHeight, setPos, setSize, setWidth, setXPos, setYPos, strictMode, validate, xCenter, xMax, xMin, xSize, yCenter, yMax, yMin, ySizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface codechicken.lib.gui.modular.lib.BackgroundRender
getBackgroundDepthMethods inherited from interface codechicken.lib.gui.modular.lib.ElementEvents
charTyped, charTyped, keyPressed, keyPressed, keyReleased, keyReleased, mouseClicked, mouseClicked, mouseMoved, mouseReleased, mouseReleased, mouseScrolled, mouseScrolledMethods inherited from interface codechicken.lib.gui.modular.lib.geometry.GuiParent
addChild, getValueMethods inherited from interface codechicken.lib.gui.modular.lib.TooltipHandler
renderTooltip, setTooltip, setTooltip, setTooltip, setTooltipSingle, setTooltipSingle
-
Field Details
-
COMMA_FORMAT
-
EMPTY
-
FULL
-
-
Constructor Details
-
GuiEnergyBar
-
-
Method Details
-
simpleBar
Creates a simple energy bar using a simple slot as a background to make it look nice. -
defaultFormatter
-
setEmptyTexture
-
setFullTexture
-
setCapacity
-
setCapacity
-
setEnergy
-
setEnergy
-
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
Description copied from interface:BackgroundRenderUsed to render content behind this elements child elements. When rendering element content, always use thePoseStackavailable via the providedGuiRenderWhere applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.- Specified by:
renderBackgroundin interfaceBackgroundRender- Parameters:
render- Contains gui context information as well as essential render methods/utils including the PoseStack.
-