Package net.minecraft.world.biome
Record Class SpawnSettings.SpawnDensity
java.lang.Object
java.lang.Record
net.minecraft.world.biome.SpawnSettings.SpawnDensity
- Record Components:
gravityLimit-mass-
- Enclosing class:
SpawnSettings
Embodies the density limit information of a type of entity in entity
spawning logic. The density field is generated for all entities spawned
than a specific type of entity.
- Mappings:
Namespace Name named net/minecraft/world/biome/SpawnSettings$SpawnDensityintermediary net/minecraft/class_5483$class_5265official dei$bnamed gravityLimitintermediary comp_1307official bnamed massintermediary comp_1308official c
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SpawnSettings.SpawnDensity> private final doubleThe field for thegravityLimitrecord component.private final doubleThe field for themassrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSpawnDensity(double gravityLimit, double mass) Creates an instance of aSpawnDensityrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleRepresents the cap of gravity as inGravityField.calculate(BlockPos, double)for entity spawning.final inthashCode()Returns a hash code value for this object.doublemass()Represents the mass of each entity spawned.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
gravityLimit
private final double gravityLimitThe field for thegravityLimitrecord component. -
mass
private final double massThe field for themassrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/world/biome/SpawnSettings$SpawnDensity;CODEC:Lcom/mojang/serialization/Codec;intermediary field_25820Lnet/minecraft/class_5483$class_5265;field_25820:Lcom/mojang/serialization/Codec;official aLdei$b;a:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
SpawnDensity
public SpawnDensity(double gravityLimit, double mass) Creates an instance of aSpawnDensityrecord class.- Parameters:
gravityLimit- the value for thegravityLimitrecord componentmass- the value for themassrecord 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 '=='. -
gravityLimit
public double gravityLimit()Represents the cap of gravity as inGravityField.calculate(BlockPos, double)for entity spawning. If the cap is exceeded, the entity spawning attempt will skip.- Mappings:
Namespace Name Mixin selector named gravityLimitLnet/minecraft/world/biome/SpawnSettings$SpawnDensity;gravityLimit()Dintermediary comp_1307Lnet/minecraft/class_5483$class_5265;comp_1307()Dofficial aLdei$b;a()D
-
mass
public double mass()Represents the mass of each entity spawned. Will affect gravity calculation.- Mappings:
Namespace Name Mixin selector named massLnet/minecraft/world/biome/SpawnSettings$SpawnDensity;mass()Dintermediary comp_1308Lnet/minecraft/class_5483$class_5265;comp_1308()Dofficial bLdei$b;b()D
-