Record Class DeathMessageRandom
java.lang.Object
java.lang.Record
net.darkhax.deathknell.common.impl.message.DeathMessageRandom
- All Implemented Interfaces:
IDeathMessage
A death message implementation that produces death messages from a predetermined range of variants.
-
Constructor Summary
ConstructorsConstructorDescriptionDeathMessageRandom(String... keys) Creates an instance of aDeathMessageRandomrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.network.chat.ComponentgetMessage(Object... args) Generates the message to display for this death message.net.minecraft.network.chat.ComponentgetSubMessage(String alt, Object... args) Generates a sub-variant of the death message.final inthashCode()Returns a hash code value for this object.String[]keys()Returns the value of thekeysrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DeathMessageRandom
Creates an instance of aDeathMessageRandomrecord class.- Parameters:
keys- the value for thekeysrecord component
-
-
Method Details
-
getMessage
Description copied from interface:IDeathMessageGenerates the message to display for this death message.- Specified by:
getMessagein interfaceIDeathMessage- Parameters:
args- The message parameters such as victim name and killer name.- Returns:
- The death message to display.
-
getSubMessage
Description copied from interface:IDeathMessageGenerates a sub-variant of the death message.- Specified by:
getSubMessagein interfaceIDeathMessage- Parameters:
alt- The variant suffix to generate.args- The message parameters such as victim name and killer name.- Returns:
- The death message to display.
-
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 withObjects::equals(Object,Object). -
keys
Returns the value of thekeysrecord component.- Returns:
- the value of the
keysrecord component
-