diff --git a/commons/src/main/kotlin/ltd/matrixstudios/alchemist/models/profile/GameProfile.kt b/commons/src/main/kotlin/ltd/matrixstudios/alchemist/models/profile/GameProfile.kt index fe605f7c1..dd9395114 100644 --- a/commons/src/main/kotlin/ltd/matrixstudios/alchemist/models/profile/GameProfile.kt +++ b/commons/src/main/kotlin/ltd/matrixstudios/alchemist/models/profile/GameProfile.kt @@ -211,6 +211,8 @@ data class GameProfile( return false } + fun altHasAnyPunishment() = alternateAccountHasMute() || alternateAccountHasBan() || alternateAccountHasBlacklist() + fun getFirstBlacklistFromAlts(): Punishment? { val alts = getAltAccounts().join() diff --git a/commons/src/main/kotlin/ltd/matrixstudios/alchemist/service/profiles/ProfileGameService.kt b/commons/src/main/kotlin/ltd/matrixstudios/alchemist/service/profiles/ProfileGameService.kt index 50d51af77..68289ad8d 100644 --- a/commons/src/main/kotlin/ltd/matrixstudios/alchemist/service/profiles/ProfileGameService.kt +++ b/commons/src/main/kotlin/ltd/matrixstudios/alchemist/service/profiles/ProfileGameService.kt @@ -58,35 +58,6 @@ object ProfileGameService : GeneralizedService { } } - fun ipReportLookup() : CompletableFuture> - { - return CompletableFuture.supplyAsync { - val ret = mutableListOf() - val allProfiles = handler.retrieveAll() - - for (profile in allProfiles) - { - for (alt in profile.getAltAccounts().join()) - { - if (alt.hasActivePunishment(PunishmentType.BLACKLIST) - || - alt.hasActivePunishment(PunishmentType.BAN) - || - alt.hasActivePunishment(PunishmentType.MUTE) - ) - { - if (!profile.hasActivePunishment(PunishmentType.BAN) && !profile.hasActivePunishment(PunishmentType.BLACKLIST)) - { - ret.add(profile) - } - } - } - } - - return@supplyAsync ret - } - } - fun getHighestRank(uuid: UUID): Rank { val current = RankService.FALLBACK_RANK val profile = byId(uuid) ?: return current diff --git a/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/broadcasts/menu/BroadcastEditSpecificsMenu.kt b/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/broadcasts/menu/BroadcastEditSpecificsMenu.kt index dd5bf9377..b100c743e 100644 --- a/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/broadcasts/menu/BroadcastEditSpecificsMenu.kt +++ b/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/broadcasts/menu/BroadcastEditSpecificsMenu.kt @@ -62,6 +62,6 @@ class BroadcastEditSpecificsMenu(val player: Player, private val broadcast: Broa } override fun getTitle(player: Player): String { - return "Editing a Broadcast..." + return "Editing Broadcast..." } } \ No newline at end of file diff --git a/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/broadcasts/menu/condition/ConditionEditorMenu.kt b/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/broadcasts/menu/condition/ConditionEditorMenu.kt index 3a9b454d4..e7567c686 100644 --- a/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/broadcasts/menu/condition/ConditionEditorMenu.kt +++ b/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/broadcasts/menu/condition/ConditionEditorMenu.kt @@ -127,6 +127,6 @@ class ConditionEditorMenu(val player: Player, private val broadcast: BroadcastMe override fun getTitle(player: Player): String { - return "Editing Broadcast Conditions" + return "Editing Conditions..." } } \ No newline at end of file diff --git a/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/commands/alts/IpReportCommand.kt b/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/commands/alts/IpReportCommand.kt index 7a5b8b0a4..4c780da7d 100644 --- a/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/commands/alts/IpReportCommand.kt +++ b/spigot/src/main/kotlin/ltd/matrixstudios/alchemist/commands/alts/IpReportCommand.kt @@ -5,13 +5,15 @@ import co.aikar.commands.annotation.CommandAlias import co.aikar.commands.annotation.CommandPermission import ltd.matrixstudios.alchemist.AlchemistSpigotPlugin import ltd.matrixstudios.alchemist.models.profile.GameProfile -import ltd.matrixstudios.alchemist.service.profiles.ProfileGameService +import ltd.matrixstudios.alchemist.profiles.getProfile import ltd.matrixstudios.alchemist.util.Chat import net.kyori.adventure.text.Component import net.kyori.adventure.text.event.HoverEvent import net.kyori.adventure.text.format.NamedTextColor +import org.bukkit.Bukkit import org.bukkit.command.CommandSender import java.util.* +import java.util.concurrent.CompletableFuture class IpReportCommand : BaseCommand() { @@ -20,7 +22,7 @@ class IpReportCommand : BaseCommand() @CommandPermission("alchemist.ipreport") fun ipreport(sender: CommandSender) { - ProfileGameService.ipReportLookup().thenAccept { + loadIpReport().thenAccept { sender.sendMessage(Chat.format("&7[&f&oMuted Alt&7, &cBanned Alt&7, &4Blacklisted Alt&7]")) sender.sendMessage(Chat.format("&aEveryone's &ealts (&6${it.size}&e):")) val finalMessage = Component.text() @@ -42,6 +44,11 @@ class IpReportCommand : BaseCommand() } } + fun loadIpReport() = CompletableFuture.supplyAsync { + Bukkit.getOnlinePlayers().filter { it.getProfile()?.altHasAnyPunishment() ?: false } + .mapNotNull { it.getProfile() } + } + fun createHover(target: GameProfile): Component { val hoverComponent =