Package ml.pluto7073.chemicals.component
Record Class ChemicalMap
java.lang.Object
java.lang.Record
ml.pluto7073.chemicals.component.ChemicalMap
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ChemicalMap> static final net.minecraft.core.component.DataComponentType<ChemicalMap> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ChemicalMap> -
Constructor Summary
ConstructorsConstructorDescriptionChemicalMap(Map<net.minecraft.resources.ResourceLocation, Float> chemicals) Creates an instance of aChemicalMaprecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thechemicalsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static voidinit()final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ChemicalMap> STREAM_CODEC -
COMPONENT_TYPE
-
-
Constructor Details
-
ChemicalMap
Creates an instance of aChemicalMaprecord class.- Parameters:
chemicals- the value for thechemicalsrecord component
-
-
Method Details
-
init
public static void init() -
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). -
chemicals
Returns the value of thechemicalsrecord component.- Returns:
- the value of the
chemicalsrecord component
-