Reach class abstract final

Reach: the one rule every swing, every use and every bite obeys.

What stands nearest along the line is what is acted on, and nothing acts through it. A creature behind a block is out of reach until the block is broken; a block behind a creature is out of reach until the creature moves. The rule is the same for everyone: the player at a crosshair, a zombie at a wall, a rider on a horse.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

nearestBody<T extends VoxelBody>(Iterable<T> bodies, Vector3 origin, Vector3 dir, {required double maxDist, double blockedAt = double.infinity, double inflate = 0.0, bool accepts(T body)?}) → T?
The nearest of bodies the line enters, no farther than maxDist and never behind blockedAt; null when a block — or nothing — is nearest. inflate grows each box, the aim's forgiveness; accepts leaves out what cannot be acted on at all (a dead mob, a boat with a driver).
toBarrier(VoxelQuery world, Vector3 origin, Vector3 dir, double maxDist) → double
How far along the line the first block that stops a body stands. A swing crosses grass, a flower and the gap in a fence, because a body does.
toBlock(VoxelQuery world, Vector3 origin, Vector3 dir, double maxDist) → double
How far along the line the first block the crosshair can pick stands, or double.infinity when the line is clear for maxDist. Every block counts, grass and flowers included: they are mined, so they are aimed at.