Record Class Projectile
java.lang.Object
java.lang.Record
com.botwithus.bot.api.snapshot.Projectile
- Record Components:
projectileId- graphic (spot-anim) id of the projectilestartCycle- game cycle the projectile was launchedendCycle- game cycle it landssourceIndex- server index of the source entity;-1if tile-anchoredsourceType- source entity-type tag (raw passthrough from the engine)targetIndex- server index of the target entity;-1if tile targettargetType- target entity-type tag (raw passthrough from the engine)startTileX- absolute world tile X of the launch pointstartTileY- absolute world tile Y of the launch pointendTileX- absolute world tile X of the target pointendTileY- absolute world tile Y of the target pointplane-0..3
public record Projectile(int projectileId, int startCycle, int endCycle, int sourceIndex, int sourceType, int targetIndex, int targetType, int startTileX, int startTileY, int endTileX, int endTileY, int plane)
extends Record
Snapshot of one in-flight projectile at the producer's current tick (v17+).
Rows come from the producer's projectile-list walk; every active projectile (a thrown spell/arrow graphic travelling source→target) is emitted. Consumers filter on the immutable snapshot.
An endpoint is either an entity or a fixed tile: when sourceIndex()
(resp. targetIndex()) is -1 the corresponding end is a tile,
given by startTileX()/startTileY() (resp.
endTileX()/endTileY()). sourceType() /
targetType() are the engine's raw entity-type tags, surfaced
unmodified for the consumer to interpret.
-
Constructor Summary
ConstructorsConstructorDescriptionProjectile(int projectileId, int startCycle, int endCycle, int sourceIndex, int sourceType, int targetIndex, int targetType, int startTileX, int startTileY, int endTileX, int endTileY, int plane) Creates an instance of aProjectilerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintendCycle()Returns the value of theendCyclerecord component.intendTileX()Returns the value of theendTileXrecord component.intendTileY()Returns the value of theendTileYrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intplane()Returns the value of theplanerecord component.intReturns the value of theprojectileIdrecord component.intReturns the value of thesourceIndexrecord component.intReturns the value of thesourceTyperecord component.intReturns the value of thestartCyclerecord component.intReturns the value of thestartTileXrecord component.intReturns the value of thestartTileYrecord component.intReturns the value of thetargetIndexrecord component.intReturns the value of thetargetTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Projectile
public Projectile(int projectileId, int startCycle, int endCycle, int sourceIndex, int sourceType, int targetIndex, int targetType, int startTileX, int startTileY, int endTileX, int endTileY, int plane) Creates an instance of aProjectilerecord class.- Parameters:
projectileId- the value for theprojectileIdrecord componentstartCycle- the value for thestartCyclerecord componentendCycle- the value for theendCyclerecord componentsourceIndex- the value for thesourceIndexrecord componentsourceType- the value for thesourceTyperecord componenttargetIndex- the value for thetargetIndexrecord componenttargetType- the value for thetargetTyperecord componentstartTileX- the value for thestartTileXrecord componentstartTileY- the value for thestartTileYrecord componentendTileX- the value for theendTileXrecord componentendTileY- the value for theendTileYrecord componentplane- the value for theplanerecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
projectileId
public int projectileId()Returns the value of theprojectileIdrecord component.- Returns:
- the value of the
projectileIdrecord component
-
startCycle
public int startCycle()Returns the value of thestartCyclerecord component.- Returns:
- the value of the
startCyclerecord component
-
endCycle
-
sourceIndex
public int sourceIndex()Returns the value of thesourceIndexrecord component.- Returns:
- the value of the
sourceIndexrecord component
-
sourceType
public int sourceType()Returns the value of thesourceTyperecord component.- Returns:
- the value of the
sourceTyperecord component
-
targetIndex
public int targetIndex()Returns the value of thetargetIndexrecord component.- Returns:
- the value of the
targetIndexrecord component
-
targetType
public int targetType()Returns the value of thetargetTyperecord component.- Returns:
- the value of the
targetTyperecord component
-
startTileX
public int startTileX()Returns the value of thestartTileXrecord component.- Returns:
- the value of the
startTileXrecord component
-
startTileY
public int startTileY()Returns the value of thestartTileYrecord component.- Returns:
- the value of the
startTileYrecord component
-
endTileX
-
endTileY
-
plane
-