Record Class GrowthAmountType<T extends GrowthAmount>
java.lang.Object
java.lang.Record
net.darkhax.botanypots.common.api.data.growthamount.GrowthAmountType<T>
public record GrowthAmountType<T extends GrowthAmount>(net.minecraft.resources.ResourceLocation typeID, com.mojang.serialization.MapCodec<T extends GrowthAmount> codec, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,T extends GrowthAmount> stream)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<GrowthAmount> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, GrowthAmount> static final com.mojang.serialization.Codec<GrowthAmountType<?>> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, ? extends GrowthAmountType<?>> -
Constructor Summary
ConstructorsConstructorDescriptionGrowthAmountType(net.minecraft.resources.ResourceLocation typeID, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> stream) Creates an instance of aGrowthAmountTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<T> codec()Returns the value of thecodecrecord component.final booleanIndicates whether some other object is "equal to" this one.static GrowthAmountType<?> get(net.minecraft.resources.ResourceLocation id) static Supplier<GrowthAmountType<?>> getLazy(net.minecraft.resources.ResourceLocation id) final inthashCode()Returns a hash code value for this object.static <T extends GrowthAmount>
GrowthAmountType<T> register(net.minecraft.resources.ResourceLocation id, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> stream) net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> stream()Returns the value of thestreamrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.resources.ResourceLocationtypeID()Returns the value of thetypeIDrecord component.
-
Field Details
-
TYPE_CODEC
-
TYPE_STREAM
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,? extends GrowthAmountType<?>> TYPE_STREAM -
GROWTH_AMOUNT_CODEC
-
GROWTH_AMOUNT_STREAM
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,GrowthAmount> GROWTH_AMOUNT_STREAM
-
-
Constructor Details
-
GrowthAmountType
public GrowthAmountType(net.minecraft.resources.ResourceLocation typeID, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> stream) Creates an instance of aGrowthAmountTyperecord class.- Parameters:
typeID- the value for thetypeIDrecord componentcodec- the value for thecodecrecord componentstream- the value for thestreamrecord component
-
-
Method Details
-
getLazy
-
get
-
register
public static <T extends GrowthAmount> GrowthAmountType<T> register(net.minecraft.resources.ResourceLocation id, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> stream) -
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). -
typeID
public net.minecraft.resources.ResourceLocation typeID()Returns the value of thetypeIDrecord component.- Returns:
- the value of the
typeIDrecord component
-
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-
stream
public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,T> stream()Returns the value of thestreamrecord component.- Returns:
- the value of the
streamrecord component
-