Skip to content

Commit

Permalink
Improvements for unregistering commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Despical committed Jun 25, 2024
1 parent b673a02 commit 915793b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public void unregisterCommand(@NotNull String commandName) {
}

this.commands.remove(command);
new HashMap<>(this.subCommands).keySet().stream().filter(subCmd -> subCmd.name().startsWith(name)).forEach(this.subCommands::remove); // Copy elements to new map to avoid modification exception
this.subCommands.entrySet().removeIf(subEntry -> subEntry.getKey().name().startsWith(name));
});
}

Expand Down

0 comments on commit 915793b

Please sign in to comment.