Record Class GotHit
java.lang.Object
java.lang.Record
dev.zwazel.internal.message.data.tank.GotHit
- Record Components:
- shooterEntity- The entity that shot the projectile
- projectileEntity- The entity of the projectile that hit this client
- hitSide- The side of this client that was hit
- damageReceived- 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 SummaryConstructors
- 
Method SummaryModifier 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.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.zwazel.internal.message.MessageDataapplyBeforeSend, applyOnAddingToQueue, applyOnReceive, isUnique
- 
Constructor Details- 
GotHitCreates an instance of aGotHitrecord class.- Parameters:
- shooterEntity- the value for the- shooterEntityrecord component
- projectileEntity- the value for the- projectileEntityrecord component
- hitSide- the value for the- hitSiderecord component
- damageReceived- the value for the- damageReceivedrecord component
 
 
- 
- 
Method Details- 
toString
- 
hashCode
- 
equalsIndicates 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.
- 
shooterEntitypublic long shooterEntity()Returns the value of theshooterEntityrecord component.- Returns:
- the value of the shooterEntityrecord component
 
- 
projectileEntitypublic long projectileEntity()Returns the value of theprojectileEntityrecord component.- Returns:
- the value of the projectileEntityrecord component
 
- 
hitSide
- 
damageReceivedpublic float damageReceived()Returns the value of thedamageReceivedrecord component.- Returns:
- the value of the damageReceivedrecord component
 
 
-