Record Class ScratchClassType<SCRATCH_CLASS extends IScratchClass<?,?>>

java.lang.Object
java.lang.Record
com.petrolpark.core.scratch.classes.ScratchClassType<SCRATCH_CLASS>
All Implemented Interfaces:
IScratchClassType

public record ScratchClassType<SCRATCH_CLASS extends IScratchClass<?,?>>(com.mojang.serialization.MapCodec<SCRATCH_CLASS extends IScratchClass<?,?>> scratchClassCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,SCRATCH_CLASS extends IScratchClass<?,?>> scratchClassStreamCodec) extends Record implements IScratchClassType
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScratchClassType(com.mojang.serialization.MapCodec<SCRATCH_CLASS> scratchClassCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,SCRATCH_CLASS> scratchClassStreamCodec)
    Creates an instance of a ScratchClassType record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    com.mojang.serialization.MapCodec<SCRATCH_CLASS>
    Returns the value of the scratchClassCodec record component.
    net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,SCRATCH_CLASS>
    Returns the value of the scratchClassStreamCodec record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • ScratchClassType

      public ScratchClassType(com.mojang.serialization.MapCodec<SCRATCH_CLASS> scratchClassCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,SCRATCH_CLASS> scratchClassStreamCodec)
      Creates an instance of a ScratchClassType record class.
      Parameters:
      scratchClassCodec - the value for the scratchClassCodec record component
      scratchClassStreamCodec - the value for the scratchClassStreamCodec record component
  • Method Details

    • 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.
    • scratchClassCodec

      public com.mojang.serialization.MapCodec<SCRATCH_CLASS> scratchClassCodec()
      Returns the value of the scratchClassCodec record component.
      Specified by:
      scratchClassCodec in interface IScratchClassType
      Returns:
      the value of the scratchClassCodec record component
    • scratchClassStreamCodec

      public net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,SCRATCH_CLASS> scratchClassStreamCodec()
      Returns the value of the scratchClassStreamCodec record component.
      Specified by:
      scratchClassStreamCodec in interface IScratchClassType
      Returns:
      the value of the scratchClassStreamCodec record component