package techcable.minecraft.npclib;

import techcable.minecraft.npclib.citizens.CitizensNPCRegistry;

import net.citizensnpcs.api.CitizensAPI;

public class NPCLib {
	private NPCLib() {};
	
	public static NPCRegistry getNPCRegistry() {
	    if (hasCitizens()) {
	        return CitizensNPCRegistry.getRegistry();
	    } else {
	        throw new UnsupportedOperationException();
	    }
	}
	
	public static boolean hasCitizens() {
		try {
			Class.forName("net.citizensnpcs.api.CitizensAPI");
		} catch (ClassNotFoundException e) {
			return false;
		}
		return CitizensAPI.hasImplementation();
	}
	public static boolean hasNMS() {
		return false;
	}
}

@@ -384,16 +384,232 @@
  %7D%0A%09%7D%0A%09%0A
+%09public static NPCRegistry getNPCRegistry(String name) %7B%0A%09    if (hasCitizens()) %7B%0A%09        return CitizensNPCRegistry.getRegistry(name);%0A%09    %7D else %7B%0A%09        throw new UnsupportedOperationException();%0A%09    %7D%0A%09%7D%0A%09%0A
 %09public 

Add support for named registries