Record Class InterpolationType<T extends Interpolation>
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.interpolation.InterpolationType<T>
public record InterpolationType<T extends Interpolation>(String name, com.mojang.serialization.MapCodec<T extends Interpolation> mapCodec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, T extends Interpolation> streamCodec, T extends Interpolation unit)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<InterpolationType<?>> static final DataType<InterpolationType<?>> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, InterpolationType<?>> -
Constructor Summary
ConstructorsConstructorDescriptionInterpolationType(String name, com.mojang.serialization.MapCodec<T> mapCodec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, T> streamCodec, T unit) Creates an instance of aInterpolationTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static Map<String, InterpolationType<?>> getMap()final inthashCode()Returns a hash code value for this object.com.mojang.serialization.MapCodec<T> mapCodec()Returns the value of themapCodecrecord component.name()Returns the value of thenamerecord component.static <T extends Interpolation>
InterpolationType<T> of(String name, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, T> streamCodec) net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, T> Returns the value of thestreamCodecrecord component.final StringtoString()Returns a string representation of this record class.unit()Returns the value of theunitrecord component.static <T extends Interpolation>
InterpolationType<T>
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, InterpolationType<?>> STREAM_CODEC -
DATA_TYPE
-
-
Constructor Details
-
InterpolationType
public InterpolationType(String name, com.mojang.serialization.MapCodec<T> mapCodec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, T> streamCodec, @Nullable T unit) Creates an instance of aInterpolationTyperecord class.- Parameters:
name- the value for thenamerecord componentmapCodec- the value for themapCodecrecord componentstreamCodec- the value for thestreamCodecrecord componentunit- the value for theunitrecord component
-
-
Method Details
-
of
public static <T extends Interpolation> InterpolationType<T> of(String name, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, T> streamCodec) -
unit
-
getMap
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
mapCodec
Returns the value of themapCodecrecord component.- Returns:
- the value of the
mapCodecrecord component
-
streamCodec
Returns the value of thestreamCodecrecord component.- Returns:
- the value of the
streamCodecrecord component
-
unit
Returns the value of theunitrecord component.- Returns:
- the value of the
unitrecord component
-