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