diff --git a/src/main/java/de/shiewk/smoderation/paper/command/BanCommand.java b/src/main/java/de/shiewk/smoderation/paper/command/BanCommand.java index 7dfbcef..6a799c5 100644 --- a/src/main/java/de/shiewk/smoderation/paper/command/BanCommand.java +++ b/src/main/java/de/shiewk/smoderation/paper/command/BanCommand.java @@ -54,7 +54,7 @@ public final class BanCommand implements CommandProvider { UUID sender = CommandUtil.getSenderUUID(context.getSource()); UUID target = context.getArgument("player", UUID.class); long duration = context.getArgument("duration", Long.class); - executeBan(punishmentManager, sender, target, duration, Punishment.DEFAULT_REASON); + executeBan(punishmentManager, sender, target, duration, SModerationPaper.config().getString("default-reason", "No reason provided.")); return Command.SINGLE_SUCCESS; } diff --git a/src/main/java/de/shiewk/smoderation/paper/command/KickCommand.java b/src/main/java/de/shiewk/smoderation/paper/command/KickCommand.java index 232438b..b1a4f67 100644 --- a/src/main/java/de/shiewk/smoderation/paper/command/KickCommand.java +++ b/src/main/java/de/shiewk/smoderation/paper/command/KickCommand.java @@ -57,7 +57,7 @@ public final class KickCommand implements CommandProvider { } UUID sender = CommandUtil.getSenderUUID(context.getSource()); Player target = CommandUtil.getPlayerSingle(context, "player"); - executeKick(punishmentManager, sender, target, Punishment.DEFAULT_REASON); + executeKick(punishmentManager, sender, target, SModerationPaper.config().getString("default-reason", "No reason provided.")); return Command.SINGLE_SUCCESS; } diff --git a/src/main/java/de/shiewk/smoderation/paper/command/MuteCommand.java b/src/main/java/de/shiewk/smoderation/paper/command/MuteCommand.java index 047ec88..05c9d96 100644 --- a/src/main/java/de/shiewk/smoderation/paper/command/MuteCommand.java +++ b/src/main/java/de/shiewk/smoderation/paper/command/MuteCommand.java @@ -54,7 +54,7 @@ public final class MuteCommand implements CommandProvider { UUID sender = CommandUtil.getSenderUUID(context.getSource()); UUID target = context.getArgument("player", UUID.class); long duration = context.getArgument("duration", Long.class); - executeMute(punishmentManager, sender, target, duration, Punishment.DEFAULT_REASON); + executeMute(punishmentManager, sender, target, duration, SModerationPaper.config().getString("default-reason", "No reason provided.")); return Command.SINGLE_SUCCESS; } diff --git a/src/main/java/de/shiewk/smoderation/paper/punishments/Punishment.java b/src/main/java/de/shiewk/smoderation/paper/punishments/Punishment.java index 9207785..ee95a05 100644 --- a/src/main/java/de/shiewk/smoderation/paper/punishments/Punishment.java +++ b/src/main/java/de/shiewk/smoderation/paper/punishments/Punishment.java @@ -17,8 +17,6 @@ import static net.kyori.adventure.text.Component.translatable; public abstract class Punishment { - public static final String DEFAULT_REASON = "No reason provided."; - protected final UUID id; protected final String type; protected final long timestamp; diff --git a/src/main/resources/default-config.yml b/src/main/resources/default-config.yml index 821895f..26399db 100644 --- a/src/main/resources/default-config.yml +++ b/src/main/resources/default-config.yml @@ -1,6 +1,10 @@ # If enabled, punishments can no longer be issued without providing a reason. force-reason: false +# The string that should be used when no reason is provided. +# This has no effect if 'force-reason' is set to true. +default-reason: No reason provided. + # Allows you to toggle specific plugin features. features: # Should punishments be tracked and executed?