Record Class SpawnSettings.SpawnDensity

java.lang.Object
java.lang.Record
net.minecraft.world.biome.SpawnSettings.SpawnDensity
Record Components:
gravityLimit -
mass -
Enclosing class:
SpawnSettings

public static record SpawnSettings.SpawnDensity(double gravityLimit, double mass) extends Record
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$SpawnDensity
intermediary net/minecraft/class_5483$class_5265
official ddk$b
named gravityLimit
intermediary comp_1307
official b
named mass
intermediary comp_1308
official c
  • Field Details

    • gravityLimit

      private final double gravityLimit
      The field for the gravityLimit record component.
    • mass

      private final double mass
      The field for the mass record component.
    • CODEC

      public static final com.mojang.serialization.Codec<SpawnSettings.SpawnDensity> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/world/biome/SpawnSettings$SpawnDensity;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_25820 Lnet/minecraft/class_5483$class_5265;field_25820:Lcom/mojang/serialization/Codec;
      official a Lddk$b;a:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • SpawnDensity

      public SpawnDensity(double gravityLimit, double mass)
      Creates an instance of a SpawnDensity record class.
      Parameters:
      gravityLimit - the value for the gravityLimit record component
      mass - the value for the mass record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • gravityLimit

      public double gravityLimit()
      Represents the cap of gravity as in GravityField.calculate(BlockPos, double) for entity spawning. If the cap is exceeded, the entity spawning attempt will skip.
      Mappings:
      Namespace Name Mixin selector
      named gravityLimit Lnet/minecraft/world/biome/SpawnSettings$SpawnDensity;gravityLimit()D
      intermediary comp_1307 Lnet/minecraft/class_5483$class_5265;comp_1307()D
      official a Lddk$b;a()D
    • mass

      public double mass()
      Represents the mass of each entity spawned. Will affect gravity calculation.
      Mappings:
      Namespace Name Mixin selector
      named mass Lnet/minecraft/world/biome/SpawnSettings$SpawnDensity;mass()D
      intermediary comp_1308 Lnet/minecraft/class_5483$class_5265;comp_1308()D
      official b Lddk$b;b()D