Record Class Food
java.lang.Object
java.lang.Record
net.minestom.server.item.component.Food
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFood(int nutrition, float saturationModifier, boolean canAlwaysEat) Creates an instance of aFoodrecord 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
-
NETWORK_TYPE
-
CODEC
-
-
Constructor Details
-
Food
public Food(int nutrition, float saturationModifier, boolean canAlwaysEat) Creates an instance of aFoodrecord class.- Parameters:
nutrition- the value for thenutritionrecord componentsaturationModifier- the value for thesaturationModifierrecord componentcanAlwaysEat- the value for thecanAlwaysEatrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-