mirror of
https://github.com/Shiewk/SModeration.git
synced 2026-04-29 06:34:17 +02:00
Add a config option to require a reason
This commit is contained in:
@@ -39,6 +39,9 @@ public final class BanCommand implements CommandProvider {
|
||||
}
|
||||
|
||||
private int banWithoutReason(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
|
||||
if (SModerationPaper.CONFIG.shouldForceReason()){
|
||||
CommandUtil.error("Please provide a reason.");
|
||||
}
|
||||
UUID sender = CommandUtil.getSenderUUID(context.getSource());
|
||||
UUID target = context.getArgument("player", UUID.class);
|
||||
long duration = context.getArgument("duration", Long.class);
|
||||
|
||||
@@ -43,6 +43,9 @@ public final class KickCommand implements CommandProvider {
|
||||
}
|
||||
|
||||
private int kickWithoutReason(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
|
||||
if (SModerationPaper.CONFIG.shouldForceReason()){
|
||||
CommandUtil.error("Please provide a reason.");
|
||||
}
|
||||
UUID sender = CommandUtil.getSenderUUID(context.getSource());
|
||||
Player target = CommandUtil.getPlayerSingle(context, "player");
|
||||
executeKick(sender, target, Punishment.DEFAULT_REASON);
|
||||
|
||||
@@ -39,6 +39,9 @@ public final class MuteCommand implements CommandProvider {
|
||||
}
|
||||
|
||||
private int muteWithoutReason(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
|
||||
if (SModerationPaper.CONFIG.shouldForceReason()){
|
||||
CommandUtil.error("Please provide a reason.");
|
||||
}
|
||||
UUID sender = CommandUtil.getSenderUUID(context.getSource());
|
||||
UUID target = context.getArgument("player", UUID.class);
|
||||
long duration = context.getArgument("duration", Long.class);
|
||||
|
||||
Reference in New Issue
Block a user