aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt11
3 files changed, 17 insertions, 8 deletions
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<String>()
}
- 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)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
index 3a86c8b54..b2ffc2826 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt
@@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.utils.LocationUtils.distanceTo
import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth
import net.minecraft.block.state.IBlockState
import net.minecraft.client.Minecraft
+import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.entity.Entity
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.item.EntityArmorStand
@@ -58,6 +59,16 @@ object EntityUtils {
}
}
+ fun getPlayerEntities(): MutableList<EntityOtherPlayerMP> {
+ val list = mutableListOf<EntityOtherPlayerMP>()
+ for (entity in Minecraft.getMinecraft().theWorld.playerEntities) {
+ if (!entity.isNPC() && entity is EntityOtherPlayerMP) {
+ list.add(entity)
+ }
+ }
+ return list
+ }
+
fun EntityLivingBase.getAllNameTagsInRadiusWith(
contains: String,
radius: Double = 3.0,