// Path: src/main/java/tc/oc/tracker/DamageInfo.java
// public interface DamageInfo {
//     /**
//      * Gets the living entity most responsible for this damage.
//      *
//      * @return Resolved damager or null if none exists
//      */
//     @Nullable LivingEntity getResolvedDamager();
// }
// 
// Path: src/main/java/tc/oc/tracker/DamageResolver.java
// public interface DamageResolver {
//     @Nullable DamageInfo resolve(@Nonnull LivingEntity entity, @Nonnull Lifetime lifetime, @Nonnull EntityDamageEvent damageEvent);
// }
// 
// Path: src/main/java/tc/oc/tracker/Lifetime.java
// public interface Lifetime {
//     @Nullable Instant getStart();
// 
//     void setStart(@Nonnull Instant start);
// 
//     @Nullable Instant getEnd();
// 
//     void setEnd(@Nonnull Instant end);
// 
//     @Nonnull List<Damage> getDamage();
// 
//     @Nonnull ListIterator<Damage> getDamageFirst();
// 
//     @Nonnull ListIterator<Damage> getDamageLast();
// 
//     @Nullable Damage getFirstDamage();
// 
//     @Nullable Damage getLastDamage();
// 
//     /**
//      * Gets the last damage instance where the info object is an instance of
//      * the specified class. Uses {@link Class#isInstance(Object)} to check info
//      * objects.
//      *
//      * @param damageInfoClass DamageInfo class to check for
//      * @return Last damage that matched or null if none matched
//      *
//      * @throws NullPointerException if damageInfoClass is null
//      */
//     @Nullable Damage getLastDamage(@Nonnull Class<? extends DamageInfo> damageInfoClass);
// 
//     void addDamage(@Nonnull Damage damage);
// }
// 
// Path: src/main/java/tc/oc/tracker/damage/DispensedProjectileDamageInfo.java
// public class DispensedProjectileDamageInfo extends ProjectileDamageInfo {
// 
//     public DispensedProjectileDamageInfo(@Nonnull Projectile projectile, @Nullable LivingEntity resolvedDamager, @Nullable Double projectileDistance, @Nullable OfflinePlayer dispenserOwner) {
//         super(projectile, resolvedDamager, projectileDistance);
//         
//         this.dispenserOwner = dispenserOwner;
//     }
// 
//     public @Nullable OfflinePlayer getdispenserOwner() {
//         return this.dispenserOwner;
//     }
// 
//     protected final @Nonnull OfflinePlayer dispenserOwner;
//     
//     @Override
//     public @Nonnull String toString() {
//         return "DispensedProjectileDamageInfo{shooter=" + this.resolvedDamager + ",projectile=" + this.projectile + ",distance=" + this.projectileDistance + ",dispenserOwner=" + this.dispenserOwner + "}";
//     }
// }
// 
// Path: src/main/java/tc/oc/tracker/trackers/DispenserTracker.java
// public interface DispenserTracker extends Tracker {
//     boolean hasOwner(@Nonnull Entity entity);
// 
//     @Nullable OfflinePlayer getOwner(@Nonnull Entity entity);
// 
//     @Nullable OfflinePlayer setOwner(@Nonnull Entity entity, @Nullable Player player);
// 
//     boolean hasPlacer(@Nonnull Block block);
// 
//     @Nullable OfflinePlayer getPlacer(@Nonnull Block block);
// 
//     @Nullable OfflinePlayer setPlacer(@Nonnull Block block, @Nullable Player player);
// 
//     @Nonnull OfflinePlayer clearPlacer(@Nonnull Block block);
// }
// 
// Path: src/main/java/tc/oc/tracker/trackers/ProjectileDistanceTracker.java
// public interface ProjectileDistanceTracker extends Tracker {
//     boolean hasLaunchLocation(@Nonnull Projectile entity);
// 
//     @Nullable Location getLaunchLocation(@Nonnull Projectile projectile);
// 
//     @Nullable Location setLaunchLocation(@Nonnull Projectile projectile, @Nullable Location location);
// }


import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import tc.oc.tracker.DamageInfo;
import tc.oc.tracker.DamageResolver;
import tc.oc.tracker.Lifetime;
import tc.oc.tracker.damage.DispensedProjectileDamageInfo;
import tc.oc.tracker.trackers.DispenserTracker;
import tc.oc.tracker.trackers.ProjectileDistanceTracker;
package tc.oc.tracker.damage.resolvers;




public class DispensedProjectileDamageResolver implements DamageResolver {
    private final ProjectileDistanceTracker projectileDistanceTracker;
    private final DispenserTracker dispenserTracker;

// Path: src/main/java/tc/oc/tracker/DamageInfo.java
// public interface DamageInfo {
//     /**
//      * Gets the living entity most responsible for this damage.
//      *
//      * @return Resolved damager or null if none exists
//      */
//     @Nullable LivingEntity getResolvedDamager();
// }
// 
// Path: src/main/java/tc/oc/tracker/DamageResolver.java
// public interface DamageResolver {
//     @Nullable DamageInfo resolve(@Nonnull LivingEntity entity, @Nonnull Lifetime lifetime, @Nonnull EntityDamageEvent damageEvent);
// }
// 
// Path: src/main/java/tc/oc/tracker/Lifetime.java
// public interface Lifetime {
//     @Nullable Instant getStart();
// 
//     void setStart(@Nonnull Instant start);
// 
//     @Nullable Instant getEnd();
// 
//     void setEnd(@Nonnull Instant end);
// 
//     @Nonnull List<Damage> getDamage();
// 
//     @Nonnull ListIterator<Damage> getDamageFirst();
// 
//     @Nonnull ListIterator<Damage> getDamageLast();
// 
//     @Nullable Damage getFirstDamage();
// 
//     @Nullable Damage getLastDamage();
// 
//     /**
//      * Gets the last damage instance where the info object is an instance of
//      * the specified class. Uses {@link Class#isInstance(Object)} to check info
//      * objects.
//      *
//      * @param damageInfoClass DamageInfo class to check for
//      * @return Last damage that matched or null if none matched
//      *
//      * @throws NullPointerException if damageInfoClass is null
//      */
//     @Nullable Damage getLastDamage(@Nonnull Class<? extends DamageInfo> damageInfoClass);
// 
//     void addDamage(@Nonnull Damage damage);
// }
// 
// Path: src/main/java/tc/oc/tracker/damage/DispensedProjectileDamageInfo.java
// public class DispensedProjectileDamageInfo extends ProjectileDamageInfo {
// 
//     public DispensedProjectileDamageInfo(@Nonnull Projectile projectile, @Nullable LivingEntity resolvedDamager, @Nullable Double projectileDistance, @Nullable OfflinePlayer dispenserOwner) {
//         super(projectile, resolvedDamager, projectileDistance);
//         
//         this.dispenserOwner = dispenserOwner;
//     }
// 
//     public @Nullable OfflinePlayer getdispenserOwner() {
//         return this.dispenserOwner;
//     }
// 
//     protected final @Nonnull OfflinePlayer dispenserOwner;
//     
//     @Override
//     public @Nonnull String toString() {
//         return "DispensedProjectileDamageInfo{shooter=" + this.resolvedDamager + ",projectile=" + this.projectile + ",distance=" + this.projectileDistance + ",dispenserOwner=" + this.dispenserOwner + "}";
//     }
// }
// 
// Path: src/main/java/tc/oc/tracker/trackers/DispenserTracker.java
// public interface DispenserTracker extends Tracker {
//     boolean hasOwner(@Nonnull Entity entity);
// 
//     @Nullable OfflinePlayer getOwner(@Nonnull Entity entity);
// 
//     @Nullable OfflinePlayer setOwner(@Nonnull Entity entity, @Nullable Player player);
// 
//     boolean hasPlacer(@Nonnull Block block);
// 
//     @Nullable OfflinePlayer getPlacer(@Nonnull Block block);
// 
//     @Nullable OfflinePlayer setPlacer(@Nonnull Block block, @Nullable Player player);
// 
//     @Nonnull OfflinePlayer clearPlacer(@Nonnull Block block);
// }
// 
// Path: src/main/java/tc/oc/tracker/trackers/ProjectileDistanceTracker.java
// public interface ProjectileDistanceTracker extends Tracker {
//     boolean hasLaunchLocation(@Nonnull Projectile entity);
// 
//     @Nullable Location getLaunchLocation(@Nonnull Projectile projectile);
// 
//     @Nullable Location setLaunchLocation(@Nonnull Projectile projectile, @Nullable Location location);
// }


// Path: src/main/java/tc/oc/tracker/damage/resolvers/DispensedProjectileDamageResolver.java
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import tc.oc.tracker.DamageInfo;
import tc.oc.tracker.DamageResolver;
import tc.oc.tracker.Lifetime;
import tc.oc.tracker.damage.DispensedProjectileDamageInfo;
import tc.oc.tracker.trackers.DispenserTracker;
import tc.oc.tracker.trackers.ProjectileDistanceTracker;

package tc.oc.tracker.damage.resolvers;




public class DispensedProjectileDamageResolver implements DamageResolver {
    private final ProjectileDistanceTracker projectileDistanceTracker;
    private final DispenserTracker dispenserTracker;

    public DispensedProjectileDamageResolver(ProjectileDistanceTracker projectileDistanceTracker, DispenserTracker dispenserTracker) {