Class PlayerFaceComponent


public final class PlayerFaceComponent extends GuiComponent<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 Details

    • PlayerFaceComponent

      public PlayerFaceComponent()
  • Method Details

    • username

      public PlayerFaceComponent username(String username)
      Resolves and displays a player by username.
      Parameters:
      username - non-blank Minecraft username
      Returns:
      this component
    • uuid

      public PlayerFaceComponent uuid(UUID uuid)
      Resolves and displays a player by UUID.
      Parameters:
      uuid - player UUID
      Returns:
      this component
    • uuid

      public PlayerFaceComponent uuid(String 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

      public PlayerFaceComponent fit(GuiImageFit fit)
      Sets how the square face fits the available content box.
      Parameters:
      fit - image fit policy
      Returns:
      this component
    • showHatLayer

      public PlayerFaceComponent showHatLayer(boolean showHatLayer)
      Selects whether the transparent outer hat/hair layer is painted above the base face.
      Parameters:
      showHatLayer - true to paint the outer layer
      Returns:
      this component
    • preferredWidth

      protected float preferredWidth(com.render.api.gui.GuiRenderContext context)
      Overrides:
      preferredWidth in class GuiComponent<PlayerFaceComponent>
    • preferredHeight

      protected float preferredHeight(com.render.api.gui.GuiRenderContext context)
      Overrides:
      preferredHeight in class GuiComponent<PlayerFaceComponent>
    • renderSelf

      protected void renderSelf(com.render.api.gui.GuiRenderContext context)
      Overrides:
      renderSelf in class GuiComponent<PlayerFaceComponent>