some stuff

This commit is contained in:
2026-06-04 16:49:50 -04:00
parent 090bf65d2e
commit ebf8072190
3 changed files with 13 additions and 2 deletions
@@ -206,11 +206,14 @@ public final class FriendCommand extends AbstractCommandCollection {
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
RankLookup ranks = NetworkCore.getInstance().getRankLookup();
net.kewwbec.networkcore.api.VanishService vanish = NetworkCore.getInstance().getVanishService();
int online = 0;
for (Friendship f : all) {
UUID otherUuid = f.fromUuid().equals(sender.getUuid()) ? f.toUuid() : f.fromUuid();
if (presence != null && presence.getLocation(otherUuid) != null) online++;
PlayerLocation loc = presence != null ? presence.getLocation(otherUuid) : null;
if (loc != null && vanish != null && vanish.isHiddenFrom(otherUuid, sender)) loc = null;
if (loc != null) online++;
}
ctx.sendMessage(Message.raw("=== Friends (" + online + "/" + all.size() + " online) ===").color(Color.YELLOW));
@@ -218,6 +221,7 @@ public final class FriendCommand extends AbstractCommandCollection {
UUID otherUuid = f.fromUuid().equals(sender.getUuid()) ? f.toUuid() : f.fromUuid();
String otherName = f.fromUuid().equals(sender.getUuid()) ? f.toName() : f.fromName();
PlayerLocation loc = (presence == null) ? null : presence.getLocation(otherUuid);
if (loc != null && vanish != null && vanish.isHiddenFrom(otherUuid, sender)) loc = null;
String status = (loc == null) ? "offline" : "online on " + loc.serverId();
RankInfo rank = (ranks == null) ? null : safeLookup(ranks, otherUuid);
ctx.sendMessage(buildRow(rank, otherName, status, loc != null));
@@ -102,11 +102,13 @@ public final class FriendsListPage {
}
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
RankLookup ranks = NetworkCore.getInstance().getRankLookup();
net.kewwbec.networkcore.api.VanishService vanish = NetworkCore.getInstance().getVanishService();
int i = 0;
for (Friendship f : friends) {
UUID otherUuid = f.fromUuid().equals(playerRef.getUuid()) ? f.toUuid() : f.fromUuid();
String otherName = f.fromUuid().equals(playerRef.getUuid()) ? f.toName() : f.fromName();
PlayerLocation loc = (presence == null) ? null : presence.getLocation(otherUuid);
if (loc != null && vanish != null && vanish.isHiddenFrom(otherUuid, playerRef)) loc = null;
String status = (loc == null) ? "offline" : "online on " + loc.serverId();
RankInfo rank = (ranks == null) ? null : safeLookup(ranks, otherUuid);
sb.append(renderNameRow(rank, otherName, status));
@@ -62,9 +62,13 @@ public final class GuildRosterPage {
List<GuildMember> roster = ctx.guilds.roster(gc.guild().id());
int online = 0;
PlayerPresence presence = NetworkCore.getInstance().getPlayerPresence();
net.kewwbec.networkcore.api.VanishService vanish = NetworkCore.getInstance().getVanishService();
if (presence != null) {
for (GuildMember m : roster) {
if (presence.getLocation(m.uuid()) != null) online++;
PlayerLocation l = presence.getLocation(m.uuid());
if (l == null) continue;
if (vanish != null && vanish.isHiddenFrom(m.uuid(), playerRef)) continue;
online++;
}
}
@@ -74,6 +78,7 @@ public final class GuildRosterPage {
String rankName = rankNames.getOrDefault(m.rankId(), "?");
String self = m.uuid().equals(playerRef.getUuid()) ? " (you)" : "";
PlayerLocation loc = (presence == null) ? null : presence.getLocation(m.uuid());
if (loc != null && vanish != null && vanish.isHiddenFrom(m.uuid(), playerRef)) loc = null;
String status = (loc == null) ? "offline" : "on " + loc.serverId();
body.append("<p>")
.append(escape(m.name()))