Package net.minecraft.world.level.biome
Record Class MobSpawnSettings.MobSpawnCost
java.lang.Object
java.lang.Record
net.minecraft.world.level.biome.MobSpawnSettings.MobSpawnCost
- Enclosing class:
MobSpawnSettings
public static record MobSpawnSettings.MobSpawnCost(double energyBudget, double charge)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleThe field for thechargerecord component.static final com.mojang.serialization.Codec<MobSpawnSettings.MobSpawnCost> private final doubleThe field for theenergyBudgetrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionMobSpawnCost(double energyBudget, double charge) Creates an instance of aMobSpawnCostrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublecharge()Returns the value of thechargerecord component.doubleReturns the value of theenergyBudgetrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
energyBudget
private final double energyBudgetThe field for theenergyBudgetrecord component. -
charge
private final double chargeThe field for thechargerecord component. -
CODEC
-
-
Constructor Details
-
MobSpawnCost
public MobSpawnCost(double energyBudget, double charge) Creates an instance of aMobSpawnCostrecord class.- Parameters:
energyBudget- the value for theenergyBudgetrecord componentcharge- the value for thechargerecord 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. All components in this record class are compared with '=='. -
energyBudget
public double energyBudget()Returns the value of theenergyBudgetrecord component.- Returns:
- the value of the
energyBudgetrecord component
-
charge
public double charge()Returns the value of thechargerecord component.- Returns:
- the value of the
chargerecord component
-