From 49b1a18d43b7e09eda3aece8d6dff25e747fbc33 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 26 May 2024 16:50:15 -0500 Subject: [PATCH] oops --- .../java/dev/plex/medina/command/impl/ReportCommand.java | 6 ++++++ .../java/dev/plex/medina/command/impl/ReportsCommand.java | 5 ++++- src/main/resources/messages.yml | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/plex/medina/command/impl/ReportCommand.java b/src/main/java/dev/plex/medina/command/impl/ReportCommand.java index d639866..d5a8e7c 100644 --- a/src/main/java/dev/plex/medina/command/impl/ReportCommand.java +++ b/src/main/java/dev/plex/medina/command/impl/ReportCommand.java @@ -31,6 +31,12 @@ public class ReportCommand extends MedinaCommand Player player = getNonNullPlayer(args[0]); + if (player.getName().equalsIgnoreCase(sender.getName())) + { + send(sender, messageComponent("cantReportYourself")); + return null; + } + String reason = StringUtils.join(args, " ", 1, args.length); Report report = new Report( diff --git a/src/main/java/dev/plex/medina/command/impl/ReportsCommand.java b/src/main/java/dev/plex/medina/command/impl/ReportsCommand.java index 776942d..6bb7a37 100644 --- a/src/main/java/dev/plex/medina/command/impl/ReportsCommand.java +++ b/src/main/java/dev/plex/medina/command/impl/ReportsCommand.java @@ -75,8 +75,11 @@ public class ReportsCommand extends MedinaCommand return null; } + default: + { + return usage(); + } } - return null; } private void readReports(@NotNull CommandSender sender, OfflinePlayer player, List reports) diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml index f57328a..8bee0d8 100644 --- a/src/main/resources/messages.yml +++ b/src/main/resources/messages.yml @@ -42,4 +42,6 @@ reportDoesntExist: "There is no report with this ID belonging to that playe # 0 - The person who initiated the report # 1 - The person being reported # 2 - The reason for the report -notifyReport: "[REPORT] {0} reported {1} for {2}" \ No newline at end of file +notifyReport: "[REPORT] {0} reported {1} for {2}" + +cantReportYourself: "You cannot report yourself." \ No newline at end of file