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 official cnr$b
intermediary net/minecraft/class_5483$class_5265
named net/minecraft/world/biome/SpawnSettings$SpawnDensity
official b
intermediary comp_1307
named gravityLimit
official c
intermediary comp_1308
named mass
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SpawnSettings.SpawnDensity>
private final double
The field for thegravityLimit
record component.private final double
The field for themass
record component. -
Constructor Summary
ConstructorDescriptionSpawnDensity
(double gravityLimit, double mass) Creates an instance of aSpawnDensity
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.double
Represents the cap of gravity as inGravityField.calculate(BlockPos, double)
for entity spawning.final int
hashCode()
Returns a hash code value for this object.double
mass()
Represents the mass of each entity spawned.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
gravityLimit
private final double gravityLimitThe field for thegravityLimit
record component. -
mass
private final double massThe field for themass
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lcnr$b;a:Lcom/mojang/serialization/Codec;
intermediary field_25820
Lnet/minecraft/class_5483$class_5265;field_25820:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/world/biome/SpawnSettings$SpawnDensity;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
SpawnDensity
public SpawnDensity(double gravityLimit, double mass) Creates an instance of aSpawnDensity
record class.- Parameters:
gravityLimit
- the value for thegravityLimit
record componentmass
- the value for themass
record 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 official a
Lcnr$b;a()D
intermediary comp_1307
Lnet/minecraft/class_5483$class_5265;comp_1307()D
named gravityLimit
Lnet/minecraft/world/biome/SpawnSettings$SpawnDensity;gravityLimit()D
-
mass
public double mass()Represents the mass of each entity spawned. Will affect gravity calculation.- Mappings:
Namespace Name Mixin selector official b
Lcnr$b;b()D
intermediary comp_1308
Lnet/minecraft/class_5483$class_5265;comp_1308()D
named mass
Lnet/minecraft/world/biome/SpawnSettings$SpawnDensity;mass()D
-