aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-04 23:44:30 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-04 23:44:30 +0200
commit7f36ca139131f02ca231ae9c1fbcc678498e633f (patch)
tree69fb9add3994b7d143523afe81aac75e54a01050 /src/main/java/at/hannibal2/skyhanni/features/misc
parent3a7630ff3d4e0f6ec65606e55d3566fffba2889d (diff)
downloadskyhanni-7f36ca139131f02ca231ae9c1fbcc678498e633f.tar.gz
skyhanni-7f36ca139131f02ca231ae9c1fbcc678498e633f.tar.bz2
skyhanni-7f36ca139131f02ca231ae9c1fbcc678498e633f.zip
Added repo support for vip visits
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt17
1 files changed, 14 insertions, 3 deletions
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 c20b64b7f..6f1aef392 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
@@ -3,10 +3,19 @@ package at.hannibal2.skyhanni.features.misc.tabcomplete
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.jsonobjects.VipVisitsJson
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object PlayerTabComplete {
private val config get() = SkyHanniMod.feature.misc.tabCompleteCommands
+ private var vipVisitsJson: VipVisitsJson? = null
+
+ @SubscribeEvent
+ fun onRepoReload(event: RepositoryReloadEvent) {
+ vipVisitsJson = event.getConstant<VipVisitsJson>("VipVisits")
+ }
enum class PlayerCategory {
PARTY,
@@ -36,7 +45,6 @@ object PlayerTabComplete {
)
val ignored = commands[command] ?: return null
-
return buildList {
if (config.friends) {
@@ -67,8 +75,11 @@ object PlayerTabComplete {
if (config.vipVisits) {
if (command == "visit") {
- add("prtlhub")
- add("PortalHub")
+ vipVisitsJson?.let {
+ for (visit in it.vipVisits) {
+ add(visit)
+ }
+ }
}
}
}