Record Class GotHit
java.lang.Object
java.lang.Record
dev.zwazel.internal.message.data.tank.GotHit
- Record Components:
shooterEntity- The entity that shot the projectileprojectileEntity- The entity of the projectile that hit this clienthitSide- The side of this client that was hitdamageReceived- The amount of damage that was received
- All Implemented Interfaces:
MessageData
public record GotHit(long shooterEntity, long projectileEntity, Side hitSide, float damageReceived)
extends Record
implements MessageData
Represents the data of a hit message.
We receive this message when this client gets hit by a projectile.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thedamageReceivedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.hitSide()Returns the value of thehitSiderecord component.longReturns the value of theprojectileEntityrecord component.longReturns the value of theshooterEntityrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.zwazel.internal.message.MessageData
applyBeforeSend, applyOnAddingToQueue, applyOnReceive, isUnique
-
Constructor Details
-
GotHit
Creates an instance of aGotHitrecord class.- Parameters:
shooterEntity- the value for theshooterEntityrecord componentprojectileEntity- the value for theprojectileEntityrecord componenthitSide- the value for thehitSiderecord componentdamageReceived- the value for thedamageReceivedrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
shooterEntity
public long shooterEntity()Returns the value of theshooterEntityrecord component.- Returns:
- the value of the
shooterEntityrecord component
-
projectileEntity
public long projectileEntity()Returns the value of theprojectileEntityrecord component.- Returns:
- the value of the
projectileEntityrecord component
-
hitSide
-
damageReceived
public float damageReceived()Returns the value of thedamageReceivedrecord component.- Returns:
- the value of the
damageReceivedrecord component
-