diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java index 03f434340..4b3c76bfc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java @@ -11,6 +11,7 @@ import mineplex.core.chatsnap.command.PushSnapshotsCommand; import mineplex.core.chatsnap.command.PushSnapshotsHandler; import mineplex.core.command.CommandCenter; import mineplex.core.common.jsonchat.JsonMessage; +import mineplex.core.common.util.BukkitFuture; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.portal.Portal; @@ -200,13 +201,22 @@ public class ReportManager if (reportCloser != null) { - Optional reasonOptional = reportResult.getReason(); - String reason = reasonOptional.isPresent() ? reasonOptional.get() : "No reason specified."; + BukkitFuture.run(() -> + { + Optional reasonOptional = reportResult.getReason(); + String prefix = getReportPrefix(reportId); + String reason = reasonOptional.isPresent() ? reasonOptional.get() : "No reason specified."; - // todo new punish gui - CommandCenter.Instance.onPlayerCommandPreprocess( - new PlayerCommandPreprocessEvent(reportCloser, - String.format("/punish %s Report #%s - %s", suspectName, reportId, reason))); + reportCloser.sendMessage( + F.main(prefix, + C.cGreen + "Report marked as: " + C.cGold + reportResult.getType().getName())); + reportCloser.sendMessage(F.main(prefix, C.cGold + reason)); + + // todo new punish gui + CommandCenter.Instance.onPlayerCommandPreprocess( + new PlayerCommandPreprocessEvent(reportCloser, + String.format("/punish %s Report #%s - %s", suspectName, reportId, reason))); + }); } }); }); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportRepository.java index ab8dd7f8c..7a36fc358 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportRepository.java @@ -412,7 +412,7 @@ public class ReportRepository PreparedStatement setReportResultStatement = connection.prepareStatement(SET_REPORT_RESULT); ReportResult reportResult = reportResultOptional.get(); setReportResultStatement.setLong(1, reportId); // report id - setReportResultStatement.setInt(2, reportResult.getResultType().getId()); // result id + setReportResultStatement.setInt(2, reportResult.getType().getId()); // result id setReportResultStatement.setString(3, reportResult.getReason().orElse(null)); // reason setReportResultStatement.setTimestamp(4, new Timestamp(reportResult.getClosedTime().getTime())); // closed time setReportResultStatement.execute(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportResult.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportResult.java index 99a6bcec2..6931cd563 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportResult.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportResult.java @@ -24,7 +24,7 @@ public class ReportResult _closedTime = closedTime; } - public ReportResultType getResultType() + public ReportResultType getType() { return _resultType; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportResultType.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportResultType.java index 25915298c..4fa67dec0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportResultType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportResultType.java @@ -1,5 +1,7 @@ package mineplex.core.report; +import org.apache.commons.lang3.StringUtils; + /** * Contains all possible outcomes for a report. */ @@ -12,11 +14,13 @@ public enum ReportResultType private final int _id; private final boolean _globalStat; + private final String _name; ReportResultType(int id, boolean globalStat) { _id = id; _globalStat = globalStat; + _name = StringUtils.capitalize(name().toLowerCase().replace('_', ' ')); } public int getId() @@ -29,6 +33,11 @@ public enum ReportResultType return _globalStat; } + public String getName() + { + return _name; + } + public static ReportResultType getById(int id) { for (ReportResultType resultType : values()) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCloseCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCloseCommand.java index f9ca11fbc..56d7e64fe 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCloseCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/command/ReportCloseCommand.java @@ -22,7 +22,7 @@ public class ReportCloseCommand extends CommandBase @Override public void Execute(final Player player, final String[] args) { - if(args == null || args.length < 2) + if (args == null || args.length < 2) { UtilPlayer.message(player, F.main(Plugin.getName(), C.cRed + "Your arguments are inappropriate for this command!")); }