Record Class ConfigKey<TYPE>
java.lang.Object
java.lang.Record
com.wildfire.common.config.value.ConfigKey<TYPE>
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionConfigKey(com.mojang.datafixers.util.Either<TYPE, Supplier<TYPE>> defaultValueSupplier, com.mojang.serialization.Codec<TYPE> codec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, TYPE> streamCodec, ConfigValidator<TYPE> validator) Creates an instance of aConfigKeyrecord class.ConfigKey(Supplier<TYPE> defaultValueSupplier, com.mojang.serialization.Codec<TYPE> baseCodec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, TYPE> streamCodec) ConfigKey(Supplier<TYPE> defaultValueSupplier, com.mojang.serialization.Codec<TYPE> baseCodec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, TYPE> streamCodec, ConfigValidator<TYPE> range) ConfigKey(TYPE defaultValue, com.mojang.serialization.Codec<TYPE> baseCodec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, TYPE> streamCodec) ConfigKey(TYPE defaultValue, com.mojang.serialization.Codec<TYPE> baseCodec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, TYPE> streamCodec, ConfigValidator<TYPE> range) -
Method Summary
Modifier and TypeMethodDescriptionstatic <TYPE> ConfigValidator<TYPE> com.mojang.serialization.Codec<TYPE> codec()Returns the value of thecodecrecord component.com.mojang.serialization.MapCodec<TYPE> codecOrDefault(String key) create(float defaultValue, float minInclusive, float maxInclusive) createValueHandler(TYPE value) Returns the value of thedefaultValueSupplierrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, TYPE> Returns the value of thestreamCodecrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thevalidatorrecord component.
-
Field Details
-
DEFAULT_TRUE
-
DEFAULT_FALSE
-
-
Constructor Details
-
ConfigKey
public ConfigKey(com.mojang.datafixers.util.Either<TYPE, Supplier<TYPE>> defaultValueSupplier, com.mojang.serialization.Codec<TYPE> codec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, TYPE> streamCodec, ConfigValidator<TYPE> validator) Creates an instance of aConfigKeyrecord class.- Parameters:
defaultValueSupplier- the value for thedefaultValueSupplierrecord componentcodec- the value for thecodecrecord componentstreamCodec- the value for thestreamCodecrecord componentvalidator- the value for thevalidatorrecord component
-
ConfigKey
-
ConfigKey
public ConfigKey(TYPE defaultValue, com.mojang.serialization.Codec<TYPE> baseCodec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, TYPE> streamCodec, ConfigValidator<TYPE> range) -
ConfigKey
-
ConfigKey
-
-
Method Details
-
alwaysTrueValidator
-
defaultValue
-
validate
-
codecOrDefault
-
createValueHandler
-
create
-
toString
-
hashCode
-
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). -
defaultValueSupplier
-
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-
streamCodec
Returns the value of thestreamCodecrecord component.- Returns:
- the value of the
streamCodecrecord component
-
validator
Returns the value of thevalidatorrecord component.- Returns:
- the value of the
validatorrecord component
-