Record Class SoupData
java.lang.Object
java.lang.Record
com.mrbysco.chowderexpress.entity.SoupData
public record SoupData(net.minecraft.world.item.ItemStack stack, int nutrition, float saturationModifier)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.net.minecraft.resources.IdentifierintReturns the value of thenutritionrecord component.floatReturns the value of thesaturationModifierrecord component.net.minecraft.world.item.ItemStackstack()Returns the value of thestackrecord component.toString()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,SoupData> STREAM_CODEC
-
-
Constructor Details
-
SoupData
public SoupData(net.minecraft.world.item.ItemStack stack, @Nullable @Nullable net.minecraft.world.food.FoodProperties foodProperties) -
SoupData
public SoupData(net.minecraft.world.item.ItemStack stack, int nutrition, float saturationModifier) Creates an instance of aSoupDatarecord class.- Parameters:
stack- the value for thestackrecord componentnutrition- the value for thenutritionrecord componentsaturationModifier- the value for thesaturationModifierrecord component
-
-
Method Details
-
identifier
public net.minecraft.resources.Identifier identifier() -
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
stack
public net.minecraft.world.item.ItemStack stack()Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-
nutrition
public int nutrition()Returns the value of thenutritionrecord component.- Returns:
- the value of the
nutritionrecord component
-
saturationModifier
public float saturationModifier()Returns the value of thesaturationModifierrecord component.- Returns:
- the value of the
saturationModifierrecord component
-