Package codechicken.microblock.item
Record Class MicroMaterialComponent
java.lang.Object
java.lang.Record
codechicken.microblock.item.MicroMaterialComponent
public record MicroMaterialComponent(int factoryId, int size, MicroMaterial material)
extends Record
Created by covers1624 on 23/10/24.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MicroMaterialComponent> static net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, MicroMaterialComponent> -
Constructor Summary
ConstructorsConstructorDescriptionMicroMaterialComponent(int factoryId, int size, MicroMaterial material) Creates an instance of aMicroMaterialComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable StandardMicroFactoryfactory()intReturns the value of thefactoryIdrecord component.static @Nullable MicroMaterialComponentgetComponent(net.minecraft.world.item.ItemStack stack) final inthashCode()Returns a hash code value for this object.material()Returns the value of thematerialrecord component.intsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,MicroMaterialComponent> STREAM_CODEC
-
-
Constructor Details
-
MicroMaterialComponent
Creates an instance of aMicroMaterialComponentrecord class.- Parameters:
factoryId- the value for thefactoryIdrecord componentsize- the value for thesizerecord componentmaterial- the value for thematerialrecord component
-
-
Method Details
-
factory
-
getComponent
@Nullable public static @Nullable MicroMaterialComponent getComponent(net.minecraft.world.item.ItemStack stack) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
factoryId
public int factoryId()Returns the value of thefactoryIdrecord component.- Returns:
- the value of the
factoryIdrecord component
-
size
public int size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
material
Returns the value of thematerialrecord component.- Returns:
- the value of the
materialrecord component
-