Do not render flairs in staff list

This commit is contained in:
Ashcon Partovi 2017-12-31 02:01:29 -07:00
parent 1db09aebd8
commit 2d73675c07
No known key found for this signature in database
GPG Key ID: 97468B9EF2123630
2 changed files with 9 additions and 4 deletions

View File

@ -18,6 +18,7 @@ import tc.oc.api.friendships.FriendshipRequest;
import tc.oc.api.friendships.FriendshipService;
import tc.oc.api.minecraft.MinecraftService;
import tc.oc.commons.bukkit.chat.Links;
import tc.oc.commons.bukkit.chat.NameStyle;
import tc.oc.commons.bukkit.chat.PlayerComponent;
import tc.oc.commons.core.util.Lazy;
import tc.oc.minecraft.scheduler.SyncExecutor;
@ -216,7 +217,7 @@ public class UserCommands implements Commands {
.extra(new Component(String.valueOf(result.documents().size()), ChatColor.AQUA))
.extra(")")
));
userFormatter.formatSessions(result.documents()).forEach(audience::sendMessage);
userFormatter.formatSessions(result.documents(), NameStyle.COLOR).forEach(audience::sendMessage);
})
);
}

View File

@ -88,10 +88,14 @@ public class UserFormatter {
}
public List<BaseComponent> formatSessions(Collection<Session> sessions) {
return formatSessions(sessions, minecraftService.getLocalServer());
return formatSessions(sessions, NameStyle.FANCY);
}
public List<BaseComponent> formatSessions(Collection<Session> sessions, ServerDoc.Identity localServer) {
public List<BaseComponent> formatSessions(Collection<Session> sessions, NameStyle style) {
return formatSessions(sessions, minecraftService.getLocalServer(), style);
}
public List<BaseComponent> formatSessions(Collection<Session> sessions, ServerDoc.Identity localServer, NameStyle style) {
List<BaseComponent> lines = new ArrayList<>();
SetMultimap<Server, BaseComponent> namesByServer = HashMultimap.create();
@ -100,7 +104,7 @@ public class UserFormatter {
if(session.end() == null) {
final Server server = serverStore.byId(session.server_id());
if(server != null) {
namesByServer.put(server, new PlayerComponent(identityProvider.createIdentity(session), NameStyle.FANCY));
namesByServer.put(server, new PlayerComponent(identityProvider.createIdentity(session), style));
}
}
}