1
mirror of https://github.com/Shiewk/SModeration.git synced 2026-04-28 05:54:16 +02:00

Add chat prefix

This commit is contained in:
Shy
2024-06-08 19:26:05 +02:00
parent fc061d64ac
commit 3542997bba
7 changed files with 41 additions and 65 deletions
@@ -42,9 +42,9 @@ public class ModLogsCommand implements CommandExecutor, TabCompleter {
return true;
}
name = PlayerUtil.offlinePlayerName(uuid);
sender.sendMessage(Component.text("Player ").color(PRIMARY_COLOR)
sender.sendMessage(CHAT_PREFIX.append(Component.text("Player ").color(PRIMARY_COLOR)
.append(Component.text(name).color(SECONDARY_COLOR))
.append(Component.text(" (%s)".formatted(uuid)).color(INACTIVE_COLOR)));
.append(Component.text(" (%s)".formatted(uuid)).color(INACTIVE_COLOR))));
UUID finalUuid = uuid;
final List<Punishment> punishments = SModeration.container.findAll(p -> p.to.equals(finalUuid) && p.isActive());
for (Punishment punishment : punishments) {
@@ -48,8 +48,8 @@ public class UnbanCommand implements CommandExecutor, TabCompleter {
UUID finalUuid = uuid;
final Punishment punishment = SModeration.container.find(p -> p.to.equals(finalUuid) && p.isActive() && p.type == PunishmentType.BAN);
if (punishment != null) {
punishment.cancel(senderUUID);
punishment.broadcastCancellation(SModeration.container);
punishment.undo(senderUUID);
punishment.broadcastUndo(SModeration.container);
} else {
sender.sendMessage(Component.text("This player is not banned.").color(NamedTextColor.RED));
}
@@ -48,8 +48,8 @@ public class UnmuteCommand implements CommandExecutor, TabCompleter {
UUID finalUuid = uuid;
final Punishment punishment = SModeration.container.find(p -> p.to.equals(finalUuid) && p.isActive() && p.type == PunishmentType.MUTE);
if (punishment != null) {
punishment.cancel(senderUUID);
punishment.broadcastCancellation(SModeration.container);
punishment.undo(senderUUID);
punishment.broadcastUndo(SModeration.container);
} else {
sender.sendMessage(Component.text("This player is not muted.").color(NamedTextColor.RED));
}