Package be.seeseemelk.mockbukkit.food
Record Class FoodConsumption
java.lang.Object
java.lang.Record
be.seeseemelk.mockbukkit.food.FoodConsumption
@Internal
public record FoodConsumption(org.bukkit.Material name, int nutrition, float saturationModifier, boolean canAlwaysEat, int eatDurationTicks, List<FoodConsumption.FoodEffect> foodEffects)
extends Record
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFoodConsumption(org.bukkit.Material name, int nutrition, float saturationModifier, boolean canAlwaysEat, int eatDurationTicks, List<FoodConsumption.FoodEffect> foodEffects) Creates an instance of aFoodConsumptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanAlwaysEatrecord component.intReturns the value of theeatDurationTicksrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefoodEffectsrecord component.static FoodConsumptiongetFor(org.bukkit.Material material) static Map<org.bukkit.Material, FoodConsumption> final inthashCode()Returns a hash code value for this object.org.bukkit.Materialname()Returns the value of thenamerecord component.intReturns the value of thenutritionrecord component.floatReturns the value of thesaturationModifierrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FoodConsumption
public FoodConsumption(org.bukkit.Material name, int nutrition, float saturationModifier, boolean canAlwaysEat, int eatDurationTicks, List<FoodConsumption.FoodEffect> foodEffects) Creates an instance of aFoodConsumptionrecord class.- Parameters:
name- the value for thenamerecord componentnutrition- the value for thenutritionrecord componentsaturationModifier- the value for thesaturationModifierrecord componentcanAlwaysEat- the value for thecanAlwaysEatrecord componenteatDurationTicks- the value for theeatDurationTicksrecord componentfoodEffects- the value for thefoodEffectsrecord component
-
-
Method Details
-
getOrCreateAllFoods
-
getFor
-
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 '=='. -
name
public org.bukkit.Material name()Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
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
-
eatDurationTicks
public int eatDurationTicks()Returns the value of theeatDurationTicksrecord component.- Returns:
- the value of the
eatDurationTicksrecord component
-
foodEffects
Returns the value of thefoodEffectsrecord component.- Returns:
- the value of the
foodEffectsrecord component
-