From 77f1cc5d8e96ac9e0d5f4ff0aedf3a735aaf4e48 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 5 Jun 2023 00:17:43 +0200 Subject: Fixed tab complete not showing up the island players --- .../skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt index 6f1aef392..66029a4ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt @@ -4,8 +4,10 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.FriendAPI import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.events.RepositoryReloadEvent -import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.EntityUtils.isNPC import at.hannibal2.skyhanni.utils.jsonobjects.VipVisitsJson +import net.minecraft.client.Minecraft +import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object PlayerTabComplete { @@ -56,9 +58,9 @@ object PlayerTabComplete { if (config.islandPlayers) { if (PlayerCategory.ISLAND_PLAYERS !in ignored) { - for (name in originalArray) { - if (name != LorenzUtils.getPlayerName()) { - add(name) + for (entity in Minecraft.getMinecraft().theWorld.playerEntities) { + if (!entity.isNPC() && entity is EntityOtherPlayerMP) { + add(entity.name) } } } -- cgit