Compare commits

..

No commits in common. "main" and "v0.2.1" have entirely different histories.
main ... v0.2.1

1 changed files with 4 additions and 1 deletions

View File

@ -48,7 +48,7 @@ public class ChatITCommand {
})
)
.then(Commands.literal("mode")
.requires(source -> source.hasPermission(2))
.requires(source -> source.hasPermission(2)) // Требует уровень разрешения 2 (оператор)
.then(Commands.argument("mode", StringArgumentType.word())
.executes(context -> {
String modeInput = StringArgumentType.getString(context, "mode").toLowerCase();
@ -61,8 +61,10 @@ public class ChatITCommand {
return 0;
}
// Установка нового режима в конфигурации
Config.setProfanityMode(newMode);
// Отправка подтверждающего сообщения
context.getSource().sendSuccess(
() -> Component.literal("Режим проверки мата установлен на: " + newMode.name().toLowerCase() + ".")
.withStyle(ChatFormatting.GREEN),
@ -75,6 +77,7 @@ public class ChatITCommand {
)
);
// Регистрация команды /r
dispatcher.register(Commands.literal("r")
.then(Commands.argument("message", MessageArgument.message())
.executes(context -> {