Package com.wdiscute.echoes.timeless
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 -
Constructor Summary
ConstructorsConstructorDescriptionTimelessEnemyEntry(net.minecraft.resources.ResourceLocation id, int preferredLevel, int levelRange, int weight, float healthIncrease, float damageIncrease, float lootRolls) Creates an instance of aTimelessEnemyEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thedamageIncreaserecord component.final booleanIndicates whether some other object is "equal to" this one.static TimelessEnemyEntrygetRandomEnemy(net.minecraft.server.level.ServerLevel sl, List<TimelessEnemyEntry> allEnemies, int level) final inthashCode()Returns a hash code value for this object.floatReturns the value of thehealthIncreaserecord component.net.minecraft.resources.ResourceLocationid()Returns the value of theidrecord component.intReturns the value of thelevelRangerecord component.floatReturns the value of thelootRollsrecord component.intReturns the value of thepreferredLevelrecord component.final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
Field Details
-
CODEC
-
-
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 aTimelessEnemyEntryrecord class.- Parameters:
id- the value for theidrecord componentpreferredLevel- the value for thepreferredLevelrecord componentlevelRange- the value for thelevelRangerecord componentweight- the value for theweightrecord componenthealthIncrease- the value for thehealthIncreaserecord componentdamageIncrease- the value for thedamageIncreaserecord componentlootRolls- the value for thelootRollsrecord component
-
-
Method Details
-
getRandomEnemy
@Nullable public static TimelessEnemyEntry getRandomEnemy(net.minecraft.server.level.ServerLevel sl, List<TimelessEnemyEntry> allEnemies, int level) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
public net.minecraft.resources.ResourceLocation id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
preferredLevel
public int preferredLevel()Returns the value of thepreferredLevelrecord component.- Returns:
- the value of the
preferredLevelrecord component
-
levelRange
public int levelRange()Returns the value of thelevelRangerecord component.- Returns:
- the value of the
levelRangerecord component
-
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-
healthIncrease
public float healthIncrease()Returns the value of thehealthIncreaserecord component.- Returns:
- the value of the
healthIncreaserecord component
-
damageIncrease
public float damageIncrease()Returns the value of thedamageIncreaserecord component.- Returns:
- the value of the
damageIncreaserecord component
-
lootRolls
public float lootRolls()Returns the value of thelootRollsrecord component.- Returns:
- the value of the
lootRollsrecord component
-