Record Class MonsterSettings

java.lang.Object
java.lang.Record
dev.wyck.wrapper.entity.data.MonsterSettings

@NullMarked @AsOf("2.4.0") public record MonsterSettings(IntProvider monsterSpawnLightTest, int monsterSpawnBlockLightLimit) extends Record
Wrapper for a dimension's monster spawn settings.
Since:
2.4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    MonsterSettings(IntProvider monsterSpawnLightTest, int monsterSpawnBlockLightLimit)
    Creates an instance of a MonsterSettings record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the monsterSpawnBlockLightLimit record component.
    Returns the value of the monsterSpawnLightTest record component.
    of(int spawnLightLevel, int blockLightLimit)
    Creates a new DimensionalMonsterSettings with the given spawn light level and block light limit.
    Vanilla overworld defaults: uniform [0, 7] spawn light, block light limit 0.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • MonsterSettings

      @AsOf("2.4.0") public MonsterSettings(IntProvider monsterSpawnLightTest, int monsterSpawnBlockLightLimit)
      Creates an instance of a MonsterSettings record class.
      Parameters:
      monsterSpawnLightTest - the value for the monsterSpawnLightTest record component
      monsterSpawnBlockLightLimit - the value for the monsterSpawnBlockLightLimit record component
  • Method Details

    • of

      @AsOf("2.4.0") public static MonsterSettings of(int spawnLightLevel, int blockLightLimit)
      Creates a new DimensionalMonsterSettings with the given spawn light level and block light limit.
      Parameters:
      spawnLightLevel - the fixed spawn light level to use for monster spawning. Must be in the range [0, 15].
      blockLightLimit - the fixed block light limit to use for monster spawning. Must be in the range [0, 15].
      Returns:
      a new DimensionalMonsterSettings with the given spawn light level and block light limit.
      Since:
      2.4.0
    • overworld

      @AsOf("2.4.0") public static MonsterSettings overworld()
      Vanilla overworld defaults: uniform [0, 7] spawn light, block light limit 0.
      Returns:
      a new DimensionalMonsterSettings with the vanilla overworld defaults.
      Since:
      2.4.0
    • 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 o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • monsterSpawnLightTest

      public IntProvider monsterSpawnLightTest()
      Returns the value of the monsterSpawnLightTest record component.
      Returns:
      the value of the monsterSpawnLightTest record component
    • monsterSpawnBlockLightLimit

      public int monsterSpawnBlockLightLimit()
      Returns the value of the monsterSpawnBlockLightLimit record component.
      Returns:
      the value of the monsterSpawnBlockLightLimit record component