// Path: api/src/main/java/net/techcable/npclib/NPC.java
// public interface NPC {
// 
//     /**
//      * Despawn this npc
//      * <p/>
//      * Once despawned it can not be respawned
//      * It will be deregistered from the registry
//      *
//      * @return true if was able to despawn
//      *
//      * @throws java.lang.IllegalStateException if the npc is already despawned
//      */
//     public void despawn();
// 
//     /**
//      * Get the nmsEntity associated with this npc
//      *
//      * @return the nmsEntity
//      */
//     public Entity getEntity();
// 
//     /**
//      * Get this npc's uuid
//      *
//      * @return the uuid of this npc
//      */
//     public UUID getUUID();
// 
//     /**
//      * Returns whether the npc is spawned
//      *
//      * @return true if the npc is spawned
//      */
//     public boolean isSpawned();
// 
//     /**
//      * Returns whether the npc has been destroyed
//      * <p>
//      * NPCs that are destroyed can never be respawned
//      * </p>
//      *
//      * @return true if the npc has been destroyed
//      */
//     public boolean isDestroyed();
// 
//     /**
//      * Spawn this npc
//      *
//      * @param toSpawn location to spawn this npc
//      *
//      * @return true if the npc was able to spawn
//      *
//      * @throws java.lang.NullPointerException if location is null
//      * @throws java.lang.IllegalArgumentException if already or spawned or {@link #despawn()} has been called
//      */
//     public void spawn(Location toSpawn);
// 
//     /**
//      * Set the protected status of this NPC
//      * true by default
//      *
//      * @param protect whether or not this npc is invincible
//      */
//     public void setProtected(boolean protect);
// 
//     /**
//      * Check if the NPC is protected from damage
//      *
//      * @return The protected status of the NPC
//      */
//     public boolean isProtected();
// 
//     /**
//      * Add the specified task to the npc
//      *
//      * @param task the task to add
//      */
//     public void addTask(AITask task);
// 
//     /**
//      * Get the npc's ai environment
//      * <p>
//      * The ai environment manages the npc's ai
//      * </p>
//      *
//      * @return the npc's ai environment
//      */
//     public AIEnvironment getAIEnvironment();
// 
// }
// 
// Path: api/src/main/java/net/techcable/npclib/nms/INPCHook.java
// public interface INPCHook {
// 
//     public void onDespawn();
// 
//     public Entity getEntity();
// }


import lombok.*;
import net.minecraft.server.v1_7_R4.Entity;
import net.techcable.npclib.NPC;
import net.techcable.npclib.nms.INPCHook;
package net.techcable.npclib.nms.versions.v1_7_R4;



@Getter
@RequiredArgsConstructor
public class NPCHook implements INPCHook {

    private final NPC npc;
    protected Entity nmsEntity;

    @Override
    public void onDespawn() {
        nmsEntity = null;
    }

    @Override
    public org.bukkit.entity.Entity getEntity() {
// Path: api/src/main/java/net/techcable/npclib/NPC.java
// public interface NPC {
// 
//     /**
//      * Despawn this npc
//      * <p/>
//      * Once despawned it can not be respawned
//      * It will be deregistered from the registry
//      *
//      * @return true if was able to despawn
//      *
//      * @throws java.lang.IllegalStateException if the npc is already despawned
//      */
//     public void despawn();
// 
//     /**
//      * Get the nmsEntity associated with this npc
//      *
//      * @return the nmsEntity
//      */
//     public Entity getEntity();
// 
//     /**
//      * Get this npc's uuid
//      *
//      * @return the uuid of this npc
//      */
//     public UUID getUUID();
// 
//     /**
//      * Returns whether the npc is spawned
//      *
//      * @return true if the npc is spawned
//      */
//     public boolean isSpawned();
// 
//     /**
//      * Returns whether the npc has been destroyed
//      * <p>
//      * NPCs that are destroyed can never be respawned
//      * </p>
//      *
//      * @return true if the npc has been destroyed
//      */
//     public boolean isDestroyed();
// 
//     /**
//      * Spawn this npc
//      *
//      * @param toSpawn location to spawn this npc
//      *
//      * @return true if the npc was able to spawn
//      *
//      * @throws java.lang.NullPointerException if location is null
//      * @throws java.lang.IllegalArgumentException if already or spawned or {@link #despawn()} has been called
//      */
//     public void spawn(Location toSpawn);
// 
//     /**
//      * Set the protected status of this NPC
//      * true by default
//      *
//      * @param protect whether or not this npc is invincible
//      */
//     public void setProtected(boolean protect);
// 
//     /**
//      * Check if the NPC is protected from damage
//      *
//      * @return The protected status of the NPC
//      */
//     public boolean isProtected();
// 
//     /**
//      * Add the specified task to the npc
//      *
//      * @param task the task to add
//      */
//     public void addTask(AITask task);
// 
//     /**
//      * Get the npc's ai environment
//      * <p>
//      * The ai environment manages the npc's ai
//      * </p>
//      *
//      * @return the npc's ai environment
//      */
//     public AIEnvironment getAIEnvironment();
// 
// }
// 
// Path: api/src/main/java/net/techcable/npclib/nms/INPCHook.java
// public interface INPCHook {
// 
//     public void onDespawn();
// 
//     public Entity getEntity();
// }


// Path: nms-v1_7_R4/src/main/java/net/techcable/npclib/nms/versions/v1_7_R4/NPCHook.java
import lombok.*;
import net.minecraft.server.v1_7_R4.Entity;
import net.techcable.npclib.NPC;
import net.techcable.npclib.nms.INPCHook;

package net.techcable.npclib.nms.versions.v1_7_R4;



@Getter
@RequiredArgsConstructor
public class NPCHook implements INPCHook {

    private final NPC npc;
    protected Entity nmsEntity;

    @Override
    public void onDespawn() {
        nmsEntity = null;
    }

    @Override
    public org.bukkit.entity.Entity getEntity() {
        return nmsEntity == null ? null : nmsEntity.getBukkitEntity();