mirror of
https://github.com/songoda/EpicHeads.git
synced 2025-01-10 10:07:48 +01:00
44 lines
1.3 KiB
Java
44 lines
1.3 KiB
Java
|
package com.songoda.epicheads.command.commands;
|
||
|
|
||
|
import com.songoda.epicheads.EpicHeads;
|
||
|
import com.songoda.epicheads.command.AbstractCommand;
|
||
|
import com.songoda.epicheads.util.Methods;
|
||
|
import org.bukkit.command.CommandSender;
|
||
|
|
||
|
public class CommandHelp extends AbstractCommand {
|
||
|
|
||
|
public CommandHelp(AbstractCommand parent) {
|
||
|
super("help", parent, false);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected ReturnType runCommand(EpicHeads instance, CommandSender sender, String... args) {
|
||
|
sender.sendMessage("");
|
||
|
sender.sendMessage(Methods.formatText(instance.getReferences().getPrefix() + "&7Version " + instance.getDescription().getVersion() + " Created with <3 by &5&l&oBrianna"));
|
||
|
|
||
|
for (AbstractCommand command : instance.getCommandManager().getCommands()) {
|
||
|
if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) {
|
||
|
sender.sendMessage(Methods.formatText("&8 - &a" + command.getSyntax() + "&7 - " + command.getDescription()));
|
||
|
}
|
||
|
}
|
||
|
sender.sendMessage("");
|
||
|
|
||
|
return ReturnType.SUCCESS;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String getPermissionNode() {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String getSyntax() {
|
||
|
return "/heads help";
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String getDescription() {
|
||
|
return "Displays this page.";
|
||
|
}
|
||
|
}
|