// Path: src/main/java/tc/oc/tracker/plugin/DamageAPIHelper.java
// public final class DamageAPIHelper {
//     /**
//      * Gets the singleton DamageAPIHelper instance.
//      *
//      * @return DamageAPIHelper instance (never null)
//      */
//     public static @Nonnull DamageAPIHelper get() {
//         return inst;
//     }
//     private static final @Nonnull DamageAPIHelper inst = new DamageAPIHelper();
// 
//     /**
//      * Fetches the given {@link DamageInfo} object specified by
//      * {@link DamageAPI#inflictDamage} so it can be fetched by the
//      * {@link DamageAPIResolver} when plugins who listen to the Bukkit event
//      * ask for it.
//      *
//      * @param event EntityDamageEvent to fetch the given damage for
//      * @return Stored damage info or null if none is stored
//      *
//      * @throws NullPointerException if event is null
//      */
//     public @Nullable DamageInfo getEventDamageInfo(@Nonnull org.bukkit.event.entity.EntityDamageEvent event) {
//         Preconditions.checkNotNull(event, "entity damage event");
// 
//         return this.eventDamageMapping.get(event);
//     }
// 
//     /**
//      * Sets the API damage info that corresponds to the specified event.
//      *
//      * Intended for internal use only, so this method is not guaranteed to stay
//      * the same through stable version releases.
//      *
//      * @param event Specified event
//      * @param damage Damage info that describes the damage or null to clear the
//      *               store information
//      * @return Previous damage info associated with the event
//      *
//      * @throws NullPointerException if event is null
//      */
//     public @Nullable DamageInfo setEventDamageInfo(@Nonnull org.bukkit.event.entity.EntityDamageEvent event, @Nullable DamageInfo info) {
//         Preconditions.checkNotNull(event, "entity damage event");
// 
//         if(info != null) {
//             return this.eventDamageMapping.put(event, info);
//         } else {
//             return this.eventDamageMapping.remove(event);
//         }
//     }
// 
//     private final @Nonnull Map<org.bukkit.event.entity.EntityDamageEvent, DamageInfo> eventDamageMapping = Maps.newHashMap();
// 
//     /**
//      * Gets our version of the EntityDamageEvent so it can be called in
//      * parallel to Bukkit's.
//      *
//      * @param bukkit Bukkit's version of the EntityDamageEvent
//      * @return Our version of the event or null if there is none registered
//      *
//      * @throws NullPointerException if bukkit is null
//      */
//     public @Nullable EntityDamageEvent getOurEvent(@Nonnull org.bukkit.event.entity.EntityDamageEvent bukkit) {
//         Preconditions.checkNotNull(bukkit, "entity damage event");
// 
//         return this.eventMapping.get(bukkit);
//     }
// 
//     /**
//      * Sets our version of the EntityDamageEvent so it can be called in
//      * parallel with Bukkit's.
//      *
//      * @param bukkit Bukkit's version of the EntityDamageEvent
//      * @param our Our version of the EntityDamageEvent or null to clear it
//      * @return The previous association or null if none existed
//      *
//      * @throws NullPointerException if bukkit is null
//      */
//     public @Nullable EntityDamageEvent setOurEvent(@Nonnull org.bukkit.event.entity.EntityDamageEvent bukkit, @Nullable EntityDamageEvent our) {
//         Preconditions.checkNotNull(bukkit, "entity damage event");
// 
//         if(our != null) {
//             return this.eventMapping.put(bukkit, our);
//         } else {
//             return this.eventMapping.remove(bukkit);
//         }
//     }
// 
//     private final @Nonnull Map<org.bukkit.event.entity.EntityDamageEvent, EntityDamageEvent> eventMapping = Maps.newHashMap();
// }


import javax.annotation.Nonnull;
import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import tc.oc.tracker.plugin.DamageAPIHelper;
import com.google.common.base.Preconditions;
package tc.oc.tracker;





/**
 * Provides convenient static API calls for other plugins to use.
 */
public final class DamageAPI {
    private DamageAPI() { }

    /**
     * Inflicts the given damage on an entity.
     *
     * This method will call the appropriate damage method and fire an {@link EntityDamageEvent}.
     *
     * @param entity Entity to inflict damage upon
     * @param damage Amount of half-hearts of damage to inflict
     * @param info {@link DamageInfo} object that details the type of damage
     * @return the final {@link Damage} object (never null)
     *
     * @throws NullPointerException if entity or info is null
     * @throws IllegalArgumentExcpetion if hearts is less than zero
     */
    public static @Nonnull Damage inflictDamage(@Nonnull LivingEntity entity, int damage, @Nonnull DamageInfo info) {
        Preconditions.checkNotNull(entity, "living entity");
        Preconditions.checkArgument(damage >= 0, "damage must be greater than or equal to zero");
        Preconditions.checkNotNull(info, "damage info");

// Path: src/main/java/tc/oc/tracker/plugin/DamageAPIHelper.java
// public final class DamageAPIHelper {
//     /**
//      * Gets the singleton DamageAPIHelper instance.
//      *
//      * @return DamageAPIHelper instance (never null)
//      */
//     public static @Nonnull DamageAPIHelper get() {
//         return inst;
//     }
//     private static final @Nonnull DamageAPIHelper inst = new DamageAPIHelper();
// 
//     /**
//      * Fetches the given {@link DamageInfo} object specified by
//      * {@link DamageAPI#inflictDamage} so it can be fetched by the
//      * {@link DamageAPIResolver} when plugins who listen to the Bukkit event
//      * ask for it.
//      *
//      * @param event EntityDamageEvent to fetch the given damage for
//      * @return Stored damage info or null if none is stored
//      *
//      * @throws NullPointerException if event is null
//      */
//     public @Nullable DamageInfo getEventDamageInfo(@Nonnull org.bukkit.event.entity.EntityDamageEvent event) {
//         Preconditions.checkNotNull(event, "entity damage event");
// 
//         return this.eventDamageMapping.get(event);
//     }
// 
//     /**
//      * Sets the API damage info that corresponds to the specified event.
//      *
//      * Intended for internal use only, so this method is not guaranteed to stay
//      * the same through stable version releases.
//      *
//      * @param event Specified event
//      * @param damage Damage info that describes the damage or null to clear the
//      *               store information
//      * @return Previous damage info associated with the event
//      *
//      * @throws NullPointerException if event is null
//      */
//     public @Nullable DamageInfo setEventDamageInfo(@Nonnull org.bukkit.event.entity.EntityDamageEvent event, @Nullable DamageInfo info) {
//         Preconditions.checkNotNull(event, "entity damage event");
// 
//         if(info != null) {
//             return this.eventDamageMapping.put(event, info);
//         } else {
//             return this.eventDamageMapping.remove(event);
//         }
//     }
// 
//     private final @Nonnull Map<org.bukkit.event.entity.EntityDamageEvent, DamageInfo> eventDamageMapping = Maps.newHashMap();
// 
//     /**
//      * Gets our version of the EntityDamageEvent so it can be called in
//      * parallel to Bukkit's.
//      *
//      * @param bukkit Bukkit's version of the EntityDamageEvent
//      * @return Our version of the event or null if there is none registered
//      *
//      * @throws NullPointerException if bukkit is null
//      */
//     public @Nullable EntityDamageEvent getOurEvent(@Nonnull org.bukkit.event.entity.EntityDamageEvent bukkit) {
//         Preconditions.checkNotNull(bukkit, "entity damage event");
// 
//         return this.eventMapping.get(bukkit);
//     }
// 
//     /**
//      * Sets our version of the EntityDamageEvent so it can be called in
//      * parallel with Bukkit's.
//      *
//      * @param bukkit Bukkit's version of the EntityDamageEvent
//      * @param our Our version of the EntityDamageEvent or null to clear it
//      * @return The previous association or null if none existed
//      *
//      * @throws NullPointerException if bukkit is null
//      */
//     public @Nullable EntityDamageEvent setOurEvent(@Nonnull org.bukkit.event.entity.EntityDamageEvent bukkit, @Nullable EntityDamageEvent our) {
//         Preconditions.checkNotNull(bukkit, "entity damage event");
// 
//         if(our != null) {
//             return this.eventMapping.put(bukkit, our);
//         } else {
//             return this.eventMapping.remove(bukkit);
//         }
//     }
// 
//     private final @Nonnull Map<org.bukkit.event.entity.EntityDamageEvent, EntityDamageEvent> eventMapping = Maps.newHashMap();
// }


// Path: src/main/java/tc/oc/tracker/DamageAPI.java
import javax.annotation.Nonnull;
import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import tc.oc.tracker.plugin.DamageAPIHelper;
import com.google.common.base.Preconditions;

package tc.oc.tracker;





/**
 * Provides convenient static API calls for other plugins to use.
 */
public final class DamageAPI {
    private DamageAPI() { }

    /**
     * Inflicts the given damage on an entity.
     *
     * This method will call the appropriate damage method and fire an {@link EntityDamageEvent}.
     *
     * @param entity Entity to inflict damage upon
     * @param damage Amount of half-hearts of damage to inflict
     * @param info {@link DamageInfo} object that details the type of damage
     * @return the final {@link Damage} object (never null)
     *
     * @throws NullPointerException if entity or info is null
     * @throws IllegalArgumentExcpetion if hearts is less than zero
     */
    public static @Nonnull Damage inflictDamage(@Nonnull LivingEntity entity, int damage, @Nonnull DamageInfo info) {
        Preconditions.checkNotNull(entity, "living entity");
        Preconditions.checkArgument(damage >= 0, "damage must be greater than or equal to zero");
        Preconditions.checkNotNull(info, "damage info");

        DamageAPIHelper helper = DamageAPIHelper.get();