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
-
Constructor Summary
ConstructorDescriptionFoodProperties1_21_2
(int nutrition, float saturationModifier, boolean canAlwaysEat) Creates an instance of aFoodProperties1_21_2
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of thecanAlwaysEat
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thenutrition
record component.float
Returns the value of thesaturationModifier
record component.final String
toString()
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_2
record class.- Parameters:
nutrition
- the value for thenutrition
record componentsaturationModifier
- the value for thesaturationModifier
record componentcanAlwaysEat
- the value for thecanAlwaysEat
record 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 thenutrition
record component.- Returns:
- the value of the
nutrition
record component
-
saturationModifier
public float saturationModifier()Returns the value of thesaturationModifier
record component.- Returns:
- the value of the
saturationModifier
record component
-
canAlwaysEat
public boolean canAlwaysEat()Returns the value of thecanAlwaysEat
record component.- Returns:
- the value of the
canAlwaysEat
record component
-