Record Class ConfigurationScreen.ConfigurationSectionScreen.Custom<T>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.gui.ConfigurationScreen.ConfigurationSectionScreen.Custom<T>
- All Implemented Interfaces:
OptionInstance.ValueSet<T>
- Enclosing class:
ConfigurationScreen.ConfigurationSectionScreen
public static record ConfigurationScreen.ConfigurationSectionScreen.Custom<T>(List<T> values)
extends Record
implements OptionInstance.ValueSet<T>
A custom variant of OptionsInstance.Enum that doesn't show the key on the button, just the value
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConfigurationScreen.ConfigurationSectionScreen.Custom<Boolean> The field for thevaluesrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<T> codec()createButton(OptionInstance.TooltipSupplier<T> tooltip, Options options, int x, int y, int width, Consumer<T> target) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.validateValue(T value) values()Returns the value of thevaluesrecord component.
-
Field Details
-
values
The field for thevaluesrecord component. -
BOOLEAN_VALUES_NO_PREFIX
public static final ConfigurationScreen.ConfigurationSectionScreen.Custom<Boolean> BOOLEAN_VALUES_NO_PREFIX
-
-
Constructor Details
-
Custom
Creates an instance of aCustomrecord class.- Parameters:
values- the value for thevaluesrecord component
-
-
Method Details
-
createButton
public Function<OptionInstance<T>,AbstractWidget> createButton(OptionInstance.TooltipSupplier<T> tooltip, Options options, int x, int y, int width, Consumer<T> target) - Specified by:
createButtonin interfaceOptionInstance.ValueSet<T>
-
validateValue
- Specified by:
validateValuein interfaceOptionInstance.ValueSet<T>
-
codec
- Specified by:
codecin interfaceOptionInstance.ValueSet<T>
-
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). -
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-