@@ -0,0 +1,1301 @@
+package org.mcphoton.impl.command;%0A%0Aimport java.util.Collections;%0Aimport java.util.HashMap;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport org.mcphoton.command.Command;%0Aimport org.mcphoton.command.CommandsRegistry;%0Aimport org.mcphoton.plugin.Plugin;%0A%0A/**%0A *%0A * @author TheElectronWill%0A */%0Apublic class PhotonCommandsRegistry implements CommandsRegistry %7B%0A%0A%09private final Map%3CString, Command%3E nameMap = new HashMap%3C%3E();%0A%09private final Map%3CPlugin, List%3CCommand%3E%3E pluginMap = new HashMap%3C%3E();%0A%0A%09@Override%0A%09public synchronized void register(Command cmd, Plugin plugin) %7B%0A%09%09nameMap.put(cmd.getName(), cmd);%0A%09%09List%3CCommand%3E list = pluginMap.get(plugin);%0A%09%09if (list == null) %7B%0A%09%09%09list = new LinkedList%3C%3E();%0A%09%09%09pluginMap.put(plugin, list);%0A%09%09%7D%0A%09%09list.add(cmd);%0A%09%7D%0A%0A%09@Override%0A%09public synchronized void unregister(Command cmd, Plugin plugin) %7B%0A%09%09nameMap.remove(cmd.getName(), cmd);%0A%09%09List%3CCommand%3E list = pluginMap.get(plugin);%0A%09%09if (list != null) %7B%0A%09%09%09list.remove(cmd);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public synchronized Command getRegistered(String cmdName) %7B%0A%09%09return nameMap.get(cmdName);%0A%09%7D%0A%0A%09@Override%0A%09public synchronized List%3CCommand%3E getAllRegistered(Plugin plugin) %7B%0A%09%09List list = pluginMap.get(plugin);%0A%09%09return list == null ? null : Collections.unmodifiableList(list);%0A%09%7D%0A%0A%7D%0A

Implement the CommandRegistry