Some stuff

This commit is contained in:
libraryaddict
2020-05-21 22:30:53 +12:00
parent 4eb367b61b
commit 3e96e765e9
7 changed files with 98 additions and 24 deletions

View File

@@ -163,19 +163,19 @@ public class LibsDisguises extends JavaPlugin {
getLogger().info("Commands has been disabled, as per config");
}
unregisterCommands();
unregisterCommands(false);
new MetricsInitalizer();
}
private void unregisterCommands() {
public void unregisterCommands(boolean force) {
CommandMap map = ReflectionManager.getCommandMap();
Map<String, Command> commands = ReflectionManager.getCommands(map);
for (String command : getDescription().getCommands().keySet()) {
PluginCommand cmd = getCommand("libsdisguises:" + command);
if (cmd.getExecutor() != this) {
if (cmd.getExecutor() != this && !force) {
continue;
}