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 Details

    • compatibilityMode

      private final boolean compatibilityMode
      The field for the compatibilityMode record component.
    • preset

      private final ConfigPreset preset
      The field for the preset record component.
    • custom

      private final Optional<ConfigData> custom
      The field for the custom record component.
    • VERSION

      public static final int VERSION
      The configuration format version.
      See Also:
      Implementation Requirements:
      The version must be 1.
    • DEFAULT

      public static final Config DEFAULT
      The default configuration.
      Implementation Requirements:
      The default config notably uses the SIMPLY_NO_SHADING preset with an empty custom data and others such as pre-enabled compatibility mode.
    • LENIENT_CODEC

      public static final com.mojang.serialization.MapCodec<Config> LENIENT_CODEC
    • CODEC

      public static final com.mojang.serialization.MapCodec<Config> CODEC
  • Constructor Details

    • Config

      public Config(boolean compatibilityMode, ConfigPreset preset, Optional<ConfigData> custom)
      Creates an instance of a Config record class.
      Parameters:
      compatibilityMode - the value for the compatibilityMode record component
      preset - the value for the preset record component
      custom - the value for the custom record component
  • Method Details

    • version

      public int version()
      Description copied from interface: IConfig
      The configuration format version.
      Specified by:
      version in interface IConfig
      Returns:
      The config version.
      Implementation Requirements:
      The version must be 1.
    • data

      public ConfigData 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

      private static com.mojang.serialization.MapCodec<Config> newCodec(CodecFieldBuilder fieldBuilder)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • compatibilityMode

      public boolean compatibilityMode()
      Returns the value of the compatibilityMode record component.
      Returns:
      the value of the compatibilityMode record component
    • preset

      public ConfigPreset preset()
      Returns the value of the preset record component.
      Returns:
      the value of the preset record component
    • custom

      public Optional<ConfigData> custom()
      Returns the value of the custom record component.
      Returns:
      the value of the custom record component