Class PlayerFaceComponent
Passive retained component that renders the flat front face of a player's
skin on managed GUI and HUD surfaces.
Usernames and UUIDs resolve through Minecraft's profile and skin caches. The deterministic vanilla default skin remains visible while lookup is pending or unavailable. The component samples the skin's eight-by-eight face region with Minecraft's nearest-neighbor skin texture and can include the transparent outer hat/hair layer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfit(GuiImageFit fit) Sets how the square face fits the available content box.protected floatpreferredHeight(com.render.api.gui.GuiRenderContext context) protected floatpreferredWidth(com.render.api.gui.GuiRenderContext context) protected voidrenderSelf(com.render.api.gui.GuiRenderContext context) showHatLayer(boolean showHatLayer) Selects whether the transparent outer hat/hair layer is painted above the base face.Resolves and displays a player by username.Parses, resolves, and displays a player by UUID string.Resolves and displays a player by UUID.Methods inherited from class GuiComponent
activeStateStyle, add, alignContent, alignItems, alignSelf, anchor, anchorName, anchorPlacement, animatedBorder, animation, applyStyle, aspectRatio, autoHeight, autoSize, autoWidth, backdropFilters, backfaceVisibility, backgroundColor, backgroundColor, backgroundLayer, backgroundLayers, backgroundLayers, border, borderCollapse, borderColor, borderColor, borderSpacing, borderWidth, boxDecorationBreak, boxGlow, boxShadow, boxShadows, boxShadows, boxSizing, breakAfter, breakBefore, breakInside, cancel, captionSide, caretStyle, centered, childGap, childLayout, childLayoutViewport, childOffsetX, childOffsetY, children, clearChildren, clipChildren, clipPath, clipsChildren, color, color, columnCount, columnFill, columnGap, columnRule, columnSpan, columnWidth, computedStyle, containsChildClipPoint, contextMenu, cornerRadius, defaultDisplay, dirtyCategories, disabled, display, emptyCells, enabled, enabled, filters, findById, findById, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, focused, focused, fragmentTree, glow, gradient, gridAutoFlow, gridPlacement, gridTemplate, handlesMouseClick, handlesMouseScroll, height, height, height, hovered, id, id, indeterminate, indeterminate, inlineStyle, inset, inset, intrinsicSize, invalidateModernLayout, isClippingChildren, isFocusable, justifyContent, justifyItems, justifySelf, lastInvalidationReason, layoutChildren, layoutFragments, listStyleImage, listStylePosition, listStyleType, margin, margin, margin, marginBreak, markerGap, markerSide, maskLayers, maskLayers, matchesStyleState, maxHeight, maxWidth, minHeight, minWidth, motionPath, onCharTyped, onFocusChanged, onKeyPressed, onModernLayoutComplete, onMouseClicked, onMouseDragged, onMouseReleased, onMouseScrolled, opacity, order, orphans, outline, padding, padding, padding, pageName, paint, parent, pause, play, position, position, preferredHeightForWidth, pressed, pseudoElementBox, pseudoElementStyle, quotes, rangeState, rangeState, readOnly, readOnly, remove, removeStyleClass, renderChildren, renderClippedChildren, renderOverlay, requestFocus, required, required, resolveBaseProperties, resume, rowGap, scrollMargin, scrollMargin, scrollSnapStop, self, shadow, shouldRouteToChildren, size, size, startingStyle, stateProvider, styleAttribute, styleAttribute, styleClass, styleClasses, styledPseudoElements, styleOpen, styleState, styleState, tabIndex, tabIndex, tableLayout, tick, tooltip, transform, transformBox, transformOrigin, transformStyle, transition, transition, transition, transition, transition, transition, transitionAll, transitionAll, transitionAll, translate, translateX, translateY, validity, validity, verticalAlign, viewTransitionName, viewTransitionName, visible, visible, widows, width, width, width, writeModernInline, writeTextShadow, writingState, x, x, y, y, zIndex
-
Constructor Details
-
PlayerFaceComponent
public PlayerFaceComponent()
-
-
Method Details
-
username
Resolves and displays a player by username.- Parameters:
username- non-blank Minecraft username- Returns:
- this component
-
uuid
Resolves and displays a player by UUID.- Parameters:
uuid- player UUID- Returns:
- this component
-
uuid
Parses, resolves, and displays a player by UUID string.- Parameters:
uuid- canonical player UUID string- Returns:
- this component
- Throws:
IllegalArgumentException- when the value is blank or malformed
-
fit
Sets how the square face fits the available content box.- Parameters:
fit- image fit policy- Returns:
- this component
-
showHatLayer
Selects whether the transparent outer hat/hair layer is painted above the base face.- Parameters:
showHatLayer-trueto paint the outer layer- Returns:
- this component
-
preferredWidth
protected float preferredWidth(com.render.api.gui.GuiRenderContext context) - Overrides:
preferredWidthin classGuiComponent<PlayerFaceComponent>
-
preferredHeight
protected float preferredHeight(com.render.api.gui.GuiRenderContext context) - Overrides:
preferredHeightin classGuiComponent<PlayerFaceComponent>
-
renderSelf
protected void renderSelf(com.render.api.gui.GuiRenderContext context) - Overrides:
renderSelfin classGuiComponent<PlayerFaceComponent>
-