aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Misc.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt17
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/VipVisitsJson.java11
4 files changed, 28 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 05b2d0cdb..b5f1a8a24 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -44,6 +44,7 @@ import at.hannibal2.skyhanni.features.misc.*
import at.hannibal2.skyhanni.features.misc.discordrpc.DiscordRPCManager
import at.hannibal2.skyhanni.features.misc.items.EstimatedItemValue
import at.hannibal2.skyhanni.features.misc.items.EstimatedWardrobePrice
+import at.hannibal2.skyhanni.features.misc.tabcomplete.PlayerTabComplete
import at.hannibal2.skyhanni.features.misc.tabcomplete.WarpTabComplete
import at.hannibal2.skyhanni.features.misc.teleportpad.TeleportPadCompactName
import at.hannibal2.skyhanni.features.misc.teleportpad.TeleportPadInventoryNumber
@@ -291,6 +292,7 @@ class SkyHanniMod {
loadModule(PocketSackInASackDisplay())
loadModule(ShowFishingItemName())
loadModule(WarpTabComplete)
+ loadModule(PlayerTabComplete)
init()
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
index dfbe7c4c4..0402c1ae2 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java
@@ -418,7 +418,7 @@ public class Misc {
public boolean party = true;
@Expose
- @ConfigOption(name = "VIP Visits", desc = "Tab complete the visit to special users like PortalHub or prtlhub")
+ @ConfigOption(name = "VIP Visits", desc = "Tab complete the visit to special users with cake souls on it.")
@ConfigEditorBoolean
public boolean vipVisits = true;
}
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)
+ }
+ }
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/VipVisitsJson.java b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/VipVisitsJson.java
new file mode 100644
index 000000000..f0490e72e
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/VipVisitsJson.java
@@ -0,0 +1,11 @@
+package at.hannibal2.skyhanni.utils.jsonobjects;
+
+import com.google.gson.annotations.Expose;
+
+import java.util.List;
+
+public class VipVisitsJson {
+
+ @Expose
+ public List<String> vipVisits;
+}