From 1a7efeabc44b40b6aa33979272a82bae826256d4 Mon Sep 17 00:00:00 2001 From: Moehritz Date: Mon, 16 Jun 2014 17:01:00 +0200 Subject: [PATCH] Fix unregisterCommand(s) - second try --- .../main/java/net/md_5/bungee/api/plugin/PluginManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java index fbd2cf3d..e3d2c1cf 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -82,7 +82,7 @@ public class PluginManager */ public void unregisterCommand(Command command) { - commandMap.values().remove( command ); + while ( commandMap.values().remove( command ) ); commandsByPlugin.values().remove( command ); } @@ -95,7 +95,8 @@ public class PluginManager { for ( Iterator it = commandsByPlugin.get( plugin ).iterator(); it.hasNext(); ) { - commandMap.values().remove( it.next() ); + Command command = it.next(); + while ( commandMap.values().remove( command ) ); it.remove(); } }