Record Class ConfigurationScreen.ConfigurationSectionScreen.Custom<T>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.gui.ConfigurationScreen.ConfigurationSectionScreen.Custom<T>
- All Implemented Interfaces:
net.minecraft.client.OptionInstance.ValueSet<T>
- Enclosing class:
ConfigurationScreen.ConfigurationSectionScreen
public static record ConfigurationScreen.ConfigurationSectionScreen.Custom<T>(List<T> values)
extends Record
implements net.minecraft.client.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 thevalues
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec
<T> codec()
createButton
(net.minecraft.client.OptionInstance.TooltipSupplier<T> tooltip, net.minecraft.client.Options options, int x, int y, int width, Consumer<T> target) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.validateValue
(T value) values()
Returns the value of thevalues
record component.
-
Field Details
-
values
The field for thevalues
record component. -
BOOLEAN_VALUES_NO_PREFIX
public static final ConfigurationScreen.ConfigurationSectionScreen.Custom<Boolean> BOOLEAN_VALUES_NO_PREFIX
-
-
Constructor Details
-
Custom
Creates an instance of aCustom
record class.- Parameters:
values
- the value for thevalues
record component
-
-
Method Details
-
createButton
public Function<net.minecraft.client.OptionInstance<T>,net.minecraft.client.gui.components.AbstractWidget> createButton(net.minecraft.client.OptionInstance.TooltipSupplier<T> tooltip, net.minecraft.client.Options options, int x, int y, int width, Consumer<T> target) - Specified by:
createButton
in interfacenet.minecraft.client.OptionInstance.ValueSet<T>
-
validateValue
- Specified by:
validateValue
in interfacenet.minecraft.client.OptionInstance.ValueSet<T>
-
codec
- Specified by:
codec
in interfacenet.minecraft.client.OptionInstance.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 thevalues
record component.- Returns:
- the value of the
values
record component
-