Class Widget

java.lang.Object
net.minecraft.client.gui.AbstractGui
net.minecraft.client.gui.widget.Widget
All Implemented Interfaces:
IGuiEventListener, IRenderable
Direct Known Subclasses:
AbstractButton, AbstractSlider, GamemodeSelectionScreen.SelectorWidget, RecipeOverlayGui.RecipeButtonWidget, RecipeWidget, TextFieldWidget, ToggleWidget

public abstract class Widget extends AbstractGui implements IRenderable, IGuiEventListener
  • Field Details

    • WIDGETS_LOCATION

      public static final ResourceLocation WIDGETS_LOCATION
    • width

      protected int width
    • height

      protected int height
    • x

      public int x
    • y

      public int y
    • message

      private ITextComponent message
    • wasHovered

      private boolean wasHovered
    • isHovered

      protected boolean isHovered
    • active

      public boolean active
    • visible

      public boolean visible
    • alpha

      protected float alpha
    • nextNarration

      protected long nextNarration
    • focused

      private boolean focused
    • UNSET_FG_COLOR

      public static final int UNSET_FG_COLOR
      See Also:
    • packedFGColor

      protected int packedFGColor
  • Constructor Details

    • Widget

      public Widget(int p_i232254_1_, int p_i232254_2_, int p_i232254_3_, int p_i232254_4_, ITextComponent p_i232254_5_)
  • Method Details

    • getHeight

      public int getHeight()
    • getYImage

      protected int getYImage(boolean p_230989_1_)
    • render

      public void render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
      Specified by:
      render in interface IRenderable
    • narrate

      protected void narrate()
    • createNarrationMessage

      protected IFormattableTextComponent createNarrationMessage()
    • renderButton

      public void renderButton(MatrixStack p_230431_1_, int p_230431_2_, int p_230431_3_, float p_230431_4_)
    • renderBg

      protected void renderBg(MatrixStack p_230441_1_, Minecraft p_230441_2_, int p_230441_3_, int p_230441_4_)
    • onClick

      public void onClick(double p_230982_1_, double p_230982_3_)
    • onRelease

      public void onRelease(double p_231000_1_, double p_231000_3_)
    • onDrag

      protected void onDrag(double p_230983_1_, double p_230983_3_, double p_230983_5_, double p_230983_7_)
    • mouseClicked

      public boolean mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_)
      Specified by:
      mouseClicked in interface IGuiEventListener
    • mouseReleased

      public boolean mouseReleased(double p_231048_1_, double p_231048_3_, int p_231048_5_)
      Specified by:
      mouseReleased in interface IGuiEventListener
    • isValidClickButton

      protected boolean isValidClickButton(int p_230987_1_)
    • mouseDragged

      public boolean mouseDragged(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_)
      Specified by:
      mouseDragged in interface IGuiEventListener
    • clicked

      protected boolean clicked(double p_230992_1_, double p_230992_3_)
    • isHovered

      public boolean isHovered()
    • changeFocus

      public boolean changeFocus(boolean p_231049_1_)
      Specified by:
      changeFocus in interface IGuiEventListener
    • onFocusedChanged

      protected void onFocusedChanged(boolean p_230995_1_)
    • isMouseOver

      public boolean isMouseOver(double p_231047_1_, double p_231047_3_)
      Specified by:
      isMouseOver in interface IGuiEventListener
    • renderToolTip

      public void renderToolTip(MatrixStack p_230443_1_, int p_230443_2_, int p_230443_3_)
    • playDownSound

      public void playDownSound(SoundHandler p_230988_1_)
    • getWidth

      public int getWidth()
    • setWidth

      public void setWidth(int p_230991_1_)
    • setHeight

      public void setHeight(int value)
    • setAlpha

      public void setAlpha(float p_230986_1_)
    • setMessage

      public void setMessage(ITextComponent p_238482_1_)
    • queueNarration

      public void queueNarration(int p_230994_1_)
    • getMessage

      public ITextComponent getMessage()
    • isFocused

      public boolean isFocused()
    • setFocused

      protected void setFocused(boolean p_230996_1_)
    • getFGColor

      public int getFGColor()
    • setFGColor

      public void setFGColor(int color)
    • clearFGColor

      public void clearFGColor()