Record Class FoodProperties1_20_5
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.FoodProperties1_20_5
- All Implemented Interfaces:
Copyable
public record FoodProperties1_20_5(int nutrition, float saturationModifier, boolean canAlwaysEat, float eatSeconds, @Nullable Item usingConvertsTo, FoodProperties1_20_5.FoodEffect[] possibleEffects)
extends Record
implements Copyable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Type<FoodProperties1_20_5>static final Type<FoodProperties1_20_5> -
Constructor Summary
ConstructorsConstructorDescriptionFoodProperties1_20_5(int nutrition, float saturationModifier, boolean canAlwaysEat, float eatSeconds, @Nullable Item usingConvertsTo, FoodProperties1_20_5.FoodEffect[] possibleEffects) Creates an instance of aFoodProperties1_20_5record class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanAlwaysEatrecord component.copy()floatReturns the value of theeatSecondsrecord 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.Returns the value of thepossibleEffectsrecord component.floatReturns the value of thesaturationModifierrecord component.final StringtoString()Returns a string representation of this record class.@Nullable ItemReturns the value of theusingConvertsTorecord component.
-
Field Details
-
TYPE1_20_5
-
TYPE1_21
-
-
Constructor Details
-
FoodProperties1_20_5
public FoodProperties1_20_5(int nutrition, float saturationModifier, boolean canAlwaysEat, float eatSeconds, @Nullable Item usingConvertsTo, FoodProperties1_20_5.FoodEffect[] possibleEffects) Creates an instance of aFoodProperties1_20_5record class.- Parameters:
nutrition- the value for thenutritionrecord componentsaturationModifier- the value for thesaturationModifierrecord componentcanAlwaysEat- the value for thecanAlwaysEatrecord componenteatSeconds- the value for theeatSecondsrecord componentusingConvertsTo- the value for theusingConvertsTorecord componentpossibleEffects- the value for thepossibleEffectsrecord component
-
-
Method Details
-
copy
-
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 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
-
eatSeconds
public float eatSeconds()Returns the value of theeatSecondsrecord component.- Returns:
- the value of the
eatSecondsrecord component
-
usingConvertsTo
Returns the value of theusingConvertsTorecord component.- Returns:
- the value of the
usingConvertsTorecord component
-
possibleEffects
Returns the value of thepossibleEffectsrecord component.- Returns:
- the value of the
possibleEffectsrecord component
-