37 lines
1.4 KiB
Java
37 lines
1.4 KiB
Java
package xyz.twovb.sgm.commands.impl;
|
|
|
|
import dev.rollczi.litecommands.annotations.command.Command;
|
|
import dev.rollczi.litecommands.annotations.context.Context;
|
|
import dev.rollczi.litecommands.annotations.execute.Execute;
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import xyz.twovb.sgm.SGM;
|
|
import xyz.twovb.toolbox.managers.PlaceholderManager;
|
|
import xyz.twovb.toolbox.utils.ChatUtils;
|
|
|
|
@Command(name = "sgm")
|
|
public class SGMCommand {
|
|
|
|
@Execute
|
|
void command(@Context CommandSender sender) {
|
|
StringBuilder builder = new StringBuilder();
|
|
StringBuilder gameBuilder = new StringBuilder();
|
|
builder.insert(0, SGM.getInstance().getMessages().getString("main-command.lines.1"));
|
|
builder.append("\n");
|
|
builder.append(SGM.getInstance().getMessages().getString("main-command.lines.2"));
|
|
builder.append("\n");
|
|
builder.append(SGM.getInstance().getMessages().getString("main-command.lines.3"));
|
|
builder.append("\n");
|
|
builder.append("Enabled games:");
|
|
builder.append("\n");
|
|
for (String game : SGM.getInstance().getGameManager().getRegisteredGames()) {
|
|
gameBuilder.append(game);
|
|
gameBuilder.append(", ");
|
|
}
|
|
builder.append(gameBuilder.toString());
|
|
String string = builder.toString();
|
|
sender.sendMessage(ChatUtils.translate(PlaceholderManager.setPlaceholders(string, sender)));
|
|
}
|
|
|
|
}
|