MagicProjectileEngine

public class MagicProjectileEngine<C extends MagicProjectileEngine.Source> implements Listener, AutoCloseable

Shared marker projectiles, steering and collision arbitration.

Invisible arrows supply the server's proven entity and block collision path. Particles render the magic flight, while this engine cancels all native arrow damage and resolves each marker through one impact ledger.

Constructors

Link copied to clipboard
public void MagicProjectileEngine(Plugin plugin, MagicProjectileEngine.ImpactHandler<C> impactHandler)

Types

Link copied to clipboard
@FunctionalInterface()
public interface ImpactHandler<T>
Link copied to clipboard
public interface Source
Link copied to clipboard
public interface Traits

Properties

Link copied to clipboard
protected final Plugin plugin

Functions

Link copied to clipboard
public Optional<LivingEntity> acquireTarget(Player owner, double range, double assistDegrees, Predicate<LivingEntity> eligibility, ToIntFunction<LivingEntity> priority)
Link copied to clipboard
public List<LivingEntity> acquireTargets(Player owner, double range, double assistDegrees, Predicate<LivingEntity> eligibility, ToIntFunction<LivingEntity> priority, int limit)
Link copied to clipboard
public static double arcSpreadOffset(double spreadDegrees, double distance, int missileIndex, int missileCount)
Link copied to clipboard
public void cancel(C cast)
Link copied to clipboard
public void cancelAll()
Link copied to clipboard
public static Location center(LivingEntity entity)
Link copied to clipboard
public void close()
Link copied to clipboard
public long currentTick()
Link copied to clipboard
protected boolean isAbsorbed(C source, Location from, Location to)
Optional host protection/event adapter.
Link copied to clipboard
public boolean launchStaff(C cast, Vector direction)
Link copied to clipboard
public boolean launchStraight(C cast, Location start, Vector direction)
Authored origins use the same physical marker and impact ledger as wand flights.
Link copied to clipboard
public boolean launchWand(C cast, List<LivingEntity> targets)
public boolean launchWand(C cast, LivingEntity target)
Link copied to clipboard
public void onMarkerHit(ProjectileHitEvent event)
Link copied to clipboard
public void onNativeMarkerDamage(EntityDamageByEntityEvent event)
Link copied to clipboard
protected void renderStraightFlight(C cast, Location location)
Link copied to clipboard
public boolean resolveMarker(Projectile projectile, LivingEntity target)
Called by a host's modeled-hitbox adapter; native hits use the same claim ledger.
Link copied to clipboard
protected ItemDisplay spawnFireballVisual(Arrow marker)
The literal vanilla fireball look without any of the entity: an inert item display that the flight teleports along the marker's path.
Link copied to clipboard
public void start()
Link copied to clipboard
public static boolean unobstructed(Location source, Location destination)
Link copied to clipboard
public static boolean validTarget(Player owner, LivingEntity target)