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