2022-12-11 13:36:24 +03:00

33 lines
776 B
Java

package ua.nanit.limbo.server.commands;
import ua.nanit.limbo.server.Command;
import ua.nanit.limbo.server.LimboServer;
import ua.nanit.limbo.server.Logger;
import java.util.Map;
public class CmdHelp implements Command {
private final LimboServer server;
public CmdHelp(LimboServer server) {
this.server = server;
}
@Override
public void execute() {
Map<String, Command> commands = server.getCommandManager().getCommands();
Logger.info("Available commands:");
for (Map.Entry<String, Command> entry : commands.entrySet()) {
Logger.info("%s - %s", entry.getKey(), entry.getValue().description());
}
}
@Override
public String description() {
return "Show this message";
}
}