Record Class VillagerFood
java.lang.Object
java.lang.Record
net.minecraft.world.food.VillagerFood
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<VillagerFood> private final intThe field for thenutritionrecord component.static final StreamCodec<io.netty.buffer.ByteBuf, VillagerFood> -
Constructor Summary
ConstructorsConstructorDescriptionVillagerFood(int nutrition) Creates an instance of aVillagerFoodrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
nutrition
private final int nutritionThe field for thenutritionrecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
VillagerFood
public VillagerFood(int nutrition) Creates an instance of aVillagerFoodrecord class.- Parameters:
nutrition- the value for thenutritionrecord 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
-