Record Class Config
java.lang.Object
java.lang.Record
io.github.startsmercury.simply_no_shading.impl.client.config.v1.Config
- Record Components:
compatibilityMode- The compatibility mode hint. This may have more effect when disabling shading. The effects may vary.preset- The configuration preset.custom- The persistent configuration data for the custom preset.
- All Implemented Interfaces:
IConfig
public record Config(boolean compatibilityMode, ConfigPreset preset, Optional<ConfigData> custom)
extends Record
implements IConfig
The Simply No Shading modification configuration, format version
1.- Since:
- 8.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<Config> private final booleanThe field for thecompatibilityModerecord component.private final Optional<ConfigData> The field for thecustomrecord component.static final ConfigThe default configuration.static final com.mojang.serialization.MapCodec<Config> private final ConfigPresetThe field for thepresetrecord component.static final intThe configuration format version.Fields inherited from interface io.github.startsmercury.simply_no_shading.impl.client.config.IConfig
MIN_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionConfig(boolean compatibilityMode, ConfigPreset preset, Optional<ConfigData> custom) Creates an instance of aConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecompatibilityModerecord component.custom()Returns the value of thecustomrecord component.data()Most of the configuration data.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.private static com.mojang.serialization.MapCodec<Config> newCodec(CodecFieldBuilder fieldBuilder) preset()Returns the value of thepresetrecord component.final StringtoString()Returns a string representation of this record class.intversion()The configuration format version.
-
Field Details
-
compatibilityMode
private final boolean compatibilityModeThe field for thecompatibilityModerecord component. -
preset
The field for thepresetrecord component. -
custom
The field for thecustomrecord component. -
VERSION
public static final int VERSIONThe configuration format version.- See Also:
- Implementation Requirements:
- The version must be
1.
-
DEFAULT
The default configuration.- Implementation Requirements:
- The default config notably uses the
SIMPLY_NO_SHADINGpreset with anemptycustom data and others such as pre-enabled compatibility mode.
-
LENIENT_CODEC
-
CODEC
-
-
Constructor Details
-
Config
Creates an instance of aConfigrecord class.- Parameters:
compatibilityMode- the value for thecompatibilityModerecord componentpreset- the value for thepresetrecord componentcustom- the value for thecustomrecord component
-
-
Method Details
-
version
public int version()Description copied from interface:IConfigThe configuration format version. -
data
Most of the configuration data.This is a convenience method in accessing the usable config data. To check the retained customized data, see
custom.- See Also:
-
newCodec
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
compatibilityMode
public boolean compatibilityMode()Returns the value of thecompatibilityModerecord component.- Returns:
- the value of the
compatibilityModerecord component
-
preset
Returns the value of thepresetrecord component.- Returns:
- the value of the
presetrecord component
-
custom
Returns the value of thecustomrecord component.- Returns:
- the value of the
customrecord component
-