diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-04 23:44:30 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-04 23:44:30 +0200 |
commit | 7f36ca139131f02ca231ae9c1fbcc678498e633f (patch) | |
tree | 69fb9add3994b7d143523afe81aac75e54a01050 /src/main | |
parent | 3a7630ff3d4e0f6ec65606e55d3566fffba2889d (diff) | |
download | skyhanni-7f36ca139131f02ca231ae9c1fbcc678498e633f.tar.gz skyhanni-7f36ca139131f02ca231ae9c1fbcc678498e633f.tar.bz2 skyhanni-7f36ca139131f02ca231ae9c1fbcc678498e633f.zip |
Added repo support for vip visits
Diffstat (limited to 'src/main')
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; +} |