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
ConstructorsConstructorDescriptionScratchClassType(com.mojang.serialization.MapCodec<SCRATCH_CLASS> scratchClassCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, SCRATCH_CLASS> scratchClassStreamCodec) Creates an instance of aScratchClassTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.mojang.serialization.MapCodec<SCRATCH_CLASS> Returns the value of thescratchClassCodecrecord component.net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, SCRATCH_CLASS> Returns the value of thescratchClassStreamCodecrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aScratchClassTyperecord class.- Parameters:
scratchClassCodec- the value for thescratchClassCodecrecord componentscratchClassStreamCodec- the value for thescratchClassStreamCodecrecord component
-
-
Method Details
-
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). -
scratchClassCodec
Returns the value of thescratchClassCodecrecord component.- Specified by:
scratchClassCodecin interfaceIScratchClassType- Returns:
- the value of the
scratchClassCodecrecord component
-
scratchClassStreamCodec
public net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,SCRATCH_CLASS> scratchClassStreamCodec()Returns the value of thescratchClassStreamCodecrecord component.- Specified by:
scratchClassStreamCodecin interfaceIScratchClassType- Returns:
- the value of the
scratchClassStreamCodecrecord component
-