package crazypants.enderzoo.waila;

import java.util.List;

import crazypants.enderzoo.EnderZoo;
import crazypants.enderzoo.entity.IEnderZooMob;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaEntityAccessor;
import mcp.mobius.waila.api.IWailaEntityProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;

public class WailaCompat implements IWailaEntityProvider
{

  private static final WailaCompat INSTANCE = new WailaCompat();

  public static void load(IWailaRegistrar registrar) {
    registrar.registerBodyProvider(INSTANCE, IEnderZooMob.class);
  }

  @Override
  public Entity getWailaOverride(IWailaEntityAccessor accessor, IWailaConfigHandler config) {
    return null;
  }

  @Override
  public List<String> getWailaHead(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) {
    return null;
  }

  @Override
  public List<String> getWailaBody(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) {
    String name = EntityList.getEntityString(entity);
    name = name.substring(EnderZoo.MODID.length() + 1, name.length());    
    String locKey = "entity." + name + ".desc.";
    String loc = null;
    for (int line = 1; !(loc = EnderZoo.proxy.translate(locKey + line)).equals(locKey + line); line++) {
      currenttip.add(loc);
    }
    return currenttip;
  }

  @Override
  public List<String> getWailaTail(Entity entity, List<String> currenttip, IWailaEntityAccessor accessor, IWailaConfigHandler config) {
    return null;
  }

  @Override
  public NBTTagCompound getNBTData(EntityPlayerMP player, Entity ent, NBTTagCompound tag, World world) {
    return tag;
  }
}

@@ -46,20 +46,68 @@
 va.util.
-List
+HashMap;%0Aimport java.util.List;%0Aimport java.util.Map
 ;%0A%0Aimpor
@@ -420,48 +420,8 @@
 ty;%0A
-import net.minecraft.entity.EntityList;%0A
 impo
@@ -541,16 +541,78 @@
 d.World;
+%0Aimport net.minecraftforge.fml.common.registry.EntityRegistry;
 %0A%0Apublic
@@ -1145,32 +1145,123 @@
 return null;%0A  %7D
+%0A  %0A  public static final Map%3CClass%3C? extends Entity%3E, String%3E ENTRY_MAP = new HashMap%3C%3E();
 %0A%0A  @Override%0A  
@@ -1394,20 +1394,17 @@
 nfig) %7B%0A
-    
+%09
 String n
@@ -1414,117 +1414,172 @@
  = E
-ntityList
+NTRY_MAP
 .get
-E
+(e
 ntity
-String(entity);%0A    name = name.substring(EnderZoo.MODID.length() + 1, name.length());    
+.getClass());%0A%09%0A%09if(name == null) %7B%0A%09%09name = EntityRegistry.getEntry(entity.getClass()).getName();%0A%09%09ENTRY_MAP.put(entity.getClass(), name);%0A%09%7D%0A%09
 %0A   
@@ -1606,16 +1606,39 @@
 tity.%22 +
+ EnderZoo.MODID + %22.%22 +
  name + 

Fix waila compat