public static Tag<Map<String, Tag>> newCompound(Map<String, ?> data)
      throws ClassNotFoundException, IllegalAccessException,
      InvocationTargetException, NoSuchFieldException, NoSuchMethodException,
      NBTLibDisabledException, UnknownTagException {
    Map<String, Tag> map;
    try {
      for (final Object o : data.values().toArray())
        Tag.class.cast(o);
      map = (Map<String, Tag>) data;
    } catch (final ClassCastException e) {
      map = new HashMap<String, Tag>();
      for (final Map.Entry<String, ?> entry : data.entrySet())
        map.put(entry.getKey(), parse(entry.getValue()));
    }
    return new Tag<Map<String, Tag>>(NBT.COMPOUND, map);
  }