Record Class FoodProperties
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.FoodProperties
public record FoodProperties(int nutrition, float saturationModifier, boolean canAlwaysEat, float eatSeconds, Item usingConvertsTo, FoodEffect[] possibleEffects)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Type<FoodProperties>
static final Type<FoodProperties>
-
Constructor Summary
ConstructorDescriptionFoodProperties
(int nutrition, float saturationModifier, boolean canAlwaysEat, float eatSeconds, Item usingConvertsTo, FoodEffect[] possibleEffects) Creates an instance of aFoodProperties
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of thecanAlwaysEat
record component.float
Returns the value of theeatSeconds
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.Returns the value of thepossibleEffects
record component.float
Returns the value of thesaturationModifier
record component.final String
toString()
Returns a string representation of this record class.Returns the value of theusingConvertsTo
record component.
-
Field Details
-
TYPE1_20_5
-
TYPE1_21
-
-
Constructor Details
-
FoodProperties
public FoodProperties(int nutrition, float saturationModifier, boolean canAlwaysEat, float eatSeconds, Item usingConvertsTo, FoodEffect[] possibleEffects) Creates an instance of aFoodProperties
record class.- Parameters:
nutrition
- the value for thenutrition
record componentsaturationModifier
- the value for thesaturationModifier
record componentcanAlwaysEat
- the value for thecanAlwaysEat
record componenteatSeconds
- the value for theeatSeconds
record componentusingConvertsTo
- the value for theusingConvertsTo
record componentpossibleEffects
- the value for thepossibleEffects
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components 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
-
eatSeconds
public float eatSeconds()Returns the value of theeatSeconds
record component.- Returns:
- the value of the
eatSeconds
record component
-
usingConvertsTo
Returns the value of theusingConvertsTo
record component.- Returns:
- the value of the
usingConvertsTo
record component
-
possibleEffects
Returns the value of thepossibleEffects
record component.- Returns:
- the value of the
possibleEffects
record component
-