@Override
public void registerBinding(String id, Keyboard defaultKey, String description, BindingExecutionDelegate callback, Plugin plugin) throws IllegalArgumentException {
if (searchBinding(id, plugin) != null) {
throw new IllegalArgumentException("This binding is already registered: " + id + " for plugin [" + plugin.getDescription().getName() + "]");
}
KeyBinding binding = new KeyBinding(id, defaultKey, description, plugin, callback);
bindings.put(binding.getUniqueId(), binding);
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
if (p instanceof SpoutPlayer) {
sendKeybinding((SpoutPlayer)p, binding);
}
}