From 3154264c4b895f5dd8f84ddff12b6bff9a075400 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:12:37 +0200 Subject: Fix: All Names Party Tab (#1340) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../at/hannibal2/skyhanni/features/commands/PartyCommands.kt | 4 +++- .../features/commands/tabcomplete/PlayerTabComplete.kt | 10 +++------- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt index 2d595eef7..e58d6c275 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.events.MessageSendToServerEvent import at.hannibal2.skyhanni.features.misc.limbo.LimboTimeTracker import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.EntityUtils import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object PartyCommands { @@ -93,7 +94,8 @@ object PartyCommands { } else { emptyList() } - return friends + getPartyCommands() + val allOnLobby = EntityUtils.getPlayerEntities().map { it.name } + return friends + getPartyCommands() + allOnLobby } return null } diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt index 014df63f7..4be8b51b8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt @@ -6,9 +6,7 @@ import at.hannibal2.skyhanni.data.FriendAPI import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.data.jsonobjects.repo.VipVisitsJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.EntityUtils.isNPC -import net.minecraft.client.Minecraft -import net.minecraft.client.entity.EntityOtherPlayerMP +import at.hannibal2.skyhanni.utils.EntityUtils import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object PlayerTabComplete { @@ -59,10 +57,8 @@ object PlayerTabComplete { } if (config.islandPlayers && PlayerCategory.ISLAND_PLAYERS !in ignored) { - for (entity in Minecraft.getMinecraft().theWorld.playerEntities) { - if (!entity.isNPC() && entity is EntityOtherPlayerMP) { - add(entity.name) - } + for (entity in EntityUtils.getPlayerEntities()) { + add(entity.name) } } -- cgit