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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    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 a GrowthAmountType record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.mojang.serialization.MapCodec<T>
    Returns the value of the codec record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    get(net.minecraft.resources.ResourceLocation id)
     
    getLazy(net.minecraft.resources.ResourceLocation id)
     
    final int
    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>
    Returns the value of the stream record component.
    final String
    Returns a string representation of this record class.
    net.minecraft.resources.ResourceLocation
    Returns the value of the typeID record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • TYPE_CODEC

      public static final com.mojang.serialization.Codec<GrowthAmountType<?>> TYPE_CODEC
    • TYPE_STREAM

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,? extends GrowthAmountType<?>> TYPE_STREAM
    • GROWTH_AMOUNT_CODEC

      public static final com.mojang.serialization.Codec<GrowthAmount> 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 a GrowthAmountType record class.
      Parameters:
      typeID - the value for the typeID record component
      codec - the value for the codec record component
      stream - the value for the stream record component
  • Method Details

    • getLazy

      public static Supplier<GrowthAmountType<?>> getLazy(net.minecraft.resources.ResourceLocation id)
    • get

      public static GrowthAmountType<?> get(net.minecraft.resources.ResourceLocation id)
    • 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

      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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • typeID

      public net.minecraft.resources.ResourceLocation typeID()
      Returns the value of the typeID record component.
      Returns:
      the value of the typeID record component
    • codec

      public com.mojang.serialization.MapCodec<T> codec()
      Returns the value of the codec record component.
      Returns:
      the value of the codec record component
    • stream

      public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,T> stream()
      Returns the value of the stream record component.
      Returns:
      the value of the stream record component