Record Class BrainDamage
java.lang.Object
java.lang.Record
com.monkey.ultimatebot.api.extension.brain.BrainDamage
public record BrainDamage(double amount, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause, @Nullable org.bukkit.entity.Entity source)
extends Record
Immutable damage signal delivered directly to one custom brain session.
-
Constructor Summary
ConstructorsConstructorDescriptionBrainDamage(double amount, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause, @Nullable org.bukkit.entity.Entity source) Creates an instance of aBrainDamagerecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleamount()Returns the value of theamountrecord component.org.bukkit.event.entity.EntityDamageEvent.DamageCausecause()Returns the value of thecauserecord component.Optional<org.bukkit.entity.Entity> final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable org.bukkit.entity.Entitysource()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BrainDamage
public BrainDamage(double amount, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause, @Nullable org.bukkit.entity.Entity source) Creates an instance of aBrainDamagerecord class.- Parameters:
amount- the value for theamountrecord componentcause- the value for thecauserecord componentsource- the value for thesourcerecord component
-
-
Method Details
-
damageSource
-
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 '=='. -
amount
public double amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
cause
public org.bukkit.event.entity.EntityDamageEvent.DamageCause cause()Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-
source
public @Nullable org.bukkit.entity.Entity source()Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-