Record Class FoodProperties1_21_2
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.FoodProperties1_21_2
public record FoodProperties1_21_2(int nutrition, float saturationModifier, boolean canAlwaysEat)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFoodProperties1_21_2(int nutrition, float saturationModifier, boolean canAlwaysEat) Creates an instance of aFoodProperties1_21_2record class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanAlwaysEatrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thenutritionrecord component.floatReturns the value of thesaturationModifierrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
TYPE
-
-
Constructor Details
-
FoodProperties1_21_2
public FoodProperties1_21_2(int nutrition, float saturationModifier, boolean canAlwaysEat) Creates an instance of aFoodProperties1_21_2record class.- Parameters:
nutrition- the value for thenutritionrecord componentsaturationModifier- the value for thesaturationModifierrecord componentcanAlwaysEat- the value for thecanAlwaysEatrecord 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 with '=='. -
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
-
canAlwaysEat
public boolean canAlwaysEat()Returns the value of thecanAlwaysEatrecord component.- Returns:
- the value of the
canAlwaysEatrecord component
-