Record Class DropDownWidget.StringOption
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.client.screens.lib.widgets.DropDownWidget.StringOption
- All Implemented Interfaces:
DropDownWidget.Option
- Enclosing class:
DropDownWidget<P extends net.minecraft.client.gui.layouts.LayoutElement>
public static record DropDownWidget.StringOption(net.minecraft.network.chat.Component value, net.minecraft.client.gui.Font font, Consumer<DropDownWidget.StringOption> onClicked)
extends Record
implements DropDownWidget.Option
-
Constructor Summary
ConstructorsConstructorDescriptionStringOption(net.minecraft.network.chat.Component value, net.minecraft.client.gui.Font font) StringOption(net.minecraft.network.chat.Component value, net.minecraft.client.gui.Font font, Consumer<DropDownWidget.StringOption> onClicked) Creates an instance of aStringOptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidclicked(int mouseX, int mouseY) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.client.gui.Fontfont()Returns the value of thefontrecord component.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theonClickedrecord component.voidrender(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int mouseX, int mouseY, float partialTicks, DropDownWidget.OptionContext context) final StringtoString()Returns a string representation of this record class.net.minecraft.network.chat.Componentvalue()Returns the value of thevaluerecord component.intwidth()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.portingdeadmods.researchd.client.screens.lib.widgets.DropDownWidget.Option
isHovered, isHovered
-
Constructor Details
-
StringOption
public StringOption(net.minecraft.network.chat.Component value, net.minecraft.client.gui.Font font) -
StringOption
public StringOption(net.minecraft.network.chat.Component value, net.minecraft.client.gui.Font font, Consumer<DropDownWidget.StringOption> onClicked) Creates an instance of aStringOptionrecord class.- Parameters:
value- the value for thevaluerecord componentfont- the value for thefontrecord componentonClicked- the value for theonClickedrecord component
-
-
Method Details
-
width
public int width()- Specified by:
widthin interfaceDropDownWidget.Option
-
height
public int height()- Specified by:
heightin interfaceDropDownWidget.Option
-
clicked
public void clicked(int mouseX, int mouseY) - Specified by:
clickedin interfaceDropDownWidget.Option
-
render
public void render(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int mouseX, int mouseY, float partialTicks, DropDownWidget.OptionContext context) - Specified by:
renderin interfaceDropDownWidget.Option
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
value
public net.minecraft.network.chat.Component value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
font
public net.minecraft.client.gui.Font font()Returns the value of thefontrecord component.- Returns:
- the value of the
fontrecord component
-
onClicked
Returns the value of theonClickedrecord component.- Returns:
- the value of the
onClickedrecord component
-