Record Class TimelessEnemyEntry

java.lang.Object
java.lang.Record
com.wdiscute.echoes.timeless.TimelessEnemyEntry

public record TimelessEnemyEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int levelRange, int weight, float healthIncrease, float damageIncrease, float lootRolls) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<TimelessEnemyEntry>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TimelessEnemyEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int levelRange, int weight, float healthIncrease, float damageIncrease, float lootRolls)
    Creates an instance of a TimelessEnemyEntry record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the value of the damageIncrease record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    getRandomEnemy(net.minecraft.server.level.ServerLevel sl, List<TimelessEnemyEntry> allEnemies, int level)
     
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the healthIncrease record component.
    net.minecraft.resources.ResourceLocation
    id()
    Returns the value of the id record component.
    int
    Returns the value of the levelRange record component.
    float
    Returns the value of the lootRolls record component.
    int
    Returns the value of the preferredLevel record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the weight record component.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • TimelessEnemyEntry

      public TimelessEnemyEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int levelRange, int weight, float healthIncrease, float damageIncrease, float lootRolls)
      Creates an instance of a TimelessEnemyEntry record class.
      Parameters:
      id - the value for the id record component
      preferredLevel - the value for the preferredLevel record component
      levelRange - the value for the levelRange record component
      weight - the value for the weight record component
      healthIncrease - the value for the healthIncrease record component
      damageIncrease - the value for the damageIncrease record component
      lootRolls - the value for the lootRolls record component
  • Method Details

    • getRandomEnemy

      @Nullable public static TimelessEnemyEntry getRandomEnemy(net.minecraft.server.level.ServerLevel sl, List<TimelessEnemyEntry> allEnemies, int level)
    • 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 '=='.
      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.
    • id

      public net.minecraft.resources.ResourceLocation id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • preferredLevel

      public int preferredLevel()
      Returns the value of the preferredLevel record component.
      Returns:
      the value of the preferredLevel record component
    • levelRange

      public int levelRange()
      Returns the value of the levelRange record component.
      Returns:
      the value of the levelRange record component
    • weight

      public int weight()
      Returns the value of the weight record component.
      Returns:
      the value of the weight record component
    • healthIncrease

      public float healthIncrease()
      Returns the value of the healthIncrease record component.
      Returns:
      the value of the healthIncrease record component
    • damageIncrease

      public float damageIncrease()
      Returns the value of the damageIncrease record component.
      Returns:
      the value of the damageIncrease record component
    • lootRolls

      public float lootRolls()
      Returns the value of the lootRolls record component.
      Returns:
      the value of the lootRolls record component