Record Class DeathMessage
java.lang.Object
java.lang.Record
net.darkhax.deathknell.common.impl.message.DeathMessage
- All Implemented Interfaces:
IDeathMessage
A simple death message provider.
-
Constructor Summary
ConstructorsConstructorDescriptionDeathMessage(String key) Creates an instance of aDeathMessagerecord 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.key()Returns the value of thekeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DeathMessage
Creates an instance of aDeathMessagerecord class.- Parameters:
key- the value for thekeyrecord 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). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-