SGM/src/main/java/xyz/twovb/sgm/commands/impl/SGMCommand.java
2vb c34a2a4d55
Some checks are pending
Build plugin / build (push) Waiting to run
levels save and load properly
2024-07-02 19:17:45 -07:00

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)));
}
}