(CommandHandler handler)
| 46 | } |
| 47 | |
| 48 | public static void load(CommandHandler handler) { |
| 49 | while (!canLoad) {} |
| 50 | |
| 51 | handler.getCommandList().forEach(command -> { |
| 52 | if (!commands.containsKey(handler.getPrefix() + command.text)) |
| 53 | commands.put(handler.getPrefix() + command.text, true); |
| 54 | }); |
| 55 | |
| 56 | Seq<String> list = (clientPrefix.equals(handler.getPrefix()) ? commands.keys().toSeq().filter(c -> c.startsWith(handler.getPrefix())) : |
| 57 | commands.keys().toSeq().filter(c -> !c.startsWith(clientPrefix))), |
| 58 | comparator = handler.getCommandList().map(command -> command.text); |
| 59 | |
| 60 | commands.forEach(command -> { |
| 61 | if (!command.value) handler.removeCommand(command.key.substring(handler.getPrefix().length())); |
| 62 | }); |
| 63 | |
| 64 | comparator.each(c -> list.remove(handler.getPrefix() + c)); |
| 65 | list.each(c -> commands.remove(c)); |
| 66 | |
| 67 | temp.putAll(commands); |
| 68 | save(); |
| 69 | } |
| 70 | |
| 71 | public static void init() { |
| 72 | if (Core.settings.has("handlerManager")) { |
no test coverage detected