-
Notifications
You must be signed in to change notification settings - Fork 14
Make reports no longer show reports with offline reportees #78
base: master
Are you sure you want to change the base?
Conversation
@@ -184,7 +189,7 @@ public void reports(final CommandContext args, final CommandSender sender) throw | |||
audience.sendMessage(new HeaderComponent(title)); | |||
for(Report report : reportResult.documents()) { | |||
if(report.reported() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should check if the player is offline here instead of in ReportFormatter. That would avoid calling audience.sendmessage()
for a bunch of empty collections.
You seem to have removed the code that makes the o flag actually do anything. Also you should probably make it so when you use the a flag it shows players that are online on other servers not just the current one |
@@ -1,12 +1,14 @@ | |||
package tc.oc.commons.bukkit.report; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your changes in reportformatter don’t seem to do anything. They can probably just be discarded.
@@ -183,8 +192,8 @@ public void reports(final CommandContext args, final CommandSender sender) throw | |||
final Audience audience = audiences.get(sender); | |||
audience.sendMessage(new HeaderComponent(title)); | |||
for(Report report : reportResult.documents()) { | |||
if(report.reported() != null) { | |||
audience.sendMessages(reportFormatter.format(report, crossServer, true)); | |||
if(report.reported() != null && onlinePlayers.find(report.reported()).isOnline()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
report.reported() != null && (showOffline || onlinePlayers.find(report.reported()).isOnline())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to figure out how to get this to work with the a
flag
No description provided.