Program: 187480
Project: 187480
Buggy source:
public SpawnFlags createEntity(){
  lastUsed=System.currentTimeMillis();
  if (status != PetState.Here && getOwner().isOnline()) {
    if (getOwner().getPlayer().isDead()) {
      status=PetState.Despawned;
      return SpawnFlags.OwnerDead;
    }
    if (getOwner().getPlayer().getGameMode() == GameMode.SPECTATOR) {
      return SpawnFlags.Spectator;
    }
    if (respawnTime <= 0) {
      Location loc=petOwner.getPlayer().getLocation();
      if (getOwner().getPlayer().isFlying()) {
        boolean groundFound=false;
        for (int i=10; i >= 0; i--) {
          Block b=loc.getBlock();
          if (b.getRelative(BlockFace.DOWN).getType().isSolid()) {
            groundFound=true;
            break;
          }
          loc=loc.subtract(0,1,0);
        }
        if (!groundFound) {
          return SpawnFlags.Flying;
        }
      }
      MyPetCallEvent event=new MyPetCallEvent(this);
      Bukkit.getServer().getPluginManager().callEvent(event);
      if (event.isCancelled()) {
        return SpawnFlags.NotAllowed;
      }
      MyPetMinecraftEntity minecraftEntity=MyPetApi.getEntityRegistry().createMinecraftEntity(this,loc.getWorld());
      if (minecraftEntity == null) {
        status=PetState.Despawned;
        return SpawnFlags.Canceled;
      }
      bukkitEntity=minecraftEntity.getBukkitEntity();
      if (getYSpawnOffset() > 0) {
        loc=loc.add(0,getYSpawnOffset(),0);
      }
      loc.setPitch(0);
      loc.setYaw(0);
      minecraftEntity.setLocation(loc);
      if (!MyPetApi.getPlatformHelper().canSpawn(loc,minecraftEntity)) {
        status=PetState.Despawned;
        return SpawnFlags.NoSpace;
      }
      MyPetApi.getEntityRegistry().spawnMinecraftEntity(minecraftEntity,loc.getWorld());
      bukkitEntity.setMetadata("String_Node_Str",new FixedMetadataValue(MyPetApi.getPlugin(),this));
      status=PetState.Here;
      if (worldGroup == null || worldGroup.equals("String_Node_Str")) {
        setWorldGroup(WorldGroup.getGroupByWorld(loc.getWorld().getName()).getName());
      }
      autoAssignSkilltree();
      wantsToRespawn=true;
      return SpawnFlags.Success;
    }
  }
  if (status == PetState.Dead) {
    return SpawnFlags.Dead;
  }
 else {
    return SpawnFlags.AlreadyHere;
  }
}

Fixed version (ground truth):
public SpawnFlags createEntity(){
  lastUsed=System.currentTimeMillis();
  if (status != PetState.Here && getOwner().isOnline()) {
    if (getOwner().getPlayer().isDead()) {
      status=PetState.Despawned;
      return SpawnFlags.OwnerDead;
    }
    if (getOwner().getPlayer().getGameMode().name().equals("String_Node_Str")) {
      return SpawnFlags.Spectator;
    }
    if (respawnTime <= 0) {
      Location loc=petOwner.getPlayer().getLocation();
      if (getOwner().getPlayer().isFlying()) {
        boolean groundFound=false;
        for (int i=10; i >= 0; i--) {
          Block b=loc.getBlock();
          if (b.getRelative(BlockFace.DOWN).getType().isSolid()) {
            groundFound=true;
            break;
          }
          loc=loc.subtract(0,1,0);
        }
        if (!groundFound) {
          return SpawnFlags.Flying;
        }
      }
      MyPetCallEvent event=new MyPetCallEvent(this);
      Bukkit.getServer().getPluginManager().callEvent(event);
      if (event.isCancelled()) {
        return SpawnFlags.NotAllowed;
      }
      MyPetMinecraftEntity minecraftEntity=MyPetApi.getEntityRegistry().createMinecraftEntity(this,loc.getWorld());
      if (minecraftEntity == null) {
        status=PetState.Despawned;
        return SpawnFlags.Canceled;
      }
      bukkitEntity=minecraftEntity.getBukkitEntity();
      if (getYSpawnOffset() > 0) {
        loc=loc.add(0,getYSpawnOffset(),0);
      }
      loc.setPitch(0);
      loc.setYaw(0);
      minecraftEntity.setLocation(loc);
      if (!MyPetApi.getPlatformHelper().canSpawn(loc,minecraftEntity)) {
        status=PetState.Despawned;
        return SpawnFlags.NoSpace;
      }
      MyPetApi.getEntityRegistry().spawnMinecraftEntity(minecraftEntity,loc.getWorld());
      bukkitEntity.setMetadata("String_Node_Str",new FixedMetadataValue(MyPetApi.getPlugin(),this));
      status=PetState.Here;
      if (worldGroup == null || worldGroup.equals("String_Node_Str")) {
        setWorldGroup(WorldGroup.getGroupByWorld(loc.getWorld().getName()).getName());
      }
      autoAssignSkilltree();
      wantsToRespawn=true;
      return SpawnFlags.Success;
    }
  }
  if (status == PetState.Dead) {
    return SpawnFlags.Dead;
  }
 else {
    return SpawnFlags.AlreadyHere;
  }
}