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/MiscConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GfsTabComplete.kt27
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/TabComplete.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/SackListJson.java11
5 files changed, 47 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 400f47497..a9c830393 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -60,6 +60,7 @@ import at.hannibal2.skyhanni.features.misc.massconfiguration.DefaultConfigFeatur
import at.hannibal2.skyhanni.features.misc.powdertracker.PowderTracker
import at.hannibal2.skyhanni.features.misc.tabcomplete.PlayerTabComplete
import at.hannibal2.skyhanni.features.misc.tabcomplete.WarpTabComplete
+import at.hannibal2.skyhanni.features.misc.tabcomplete.GfsTabComplete
import at.hannibal2.skyhanni.features.misc.teleportpad.TeleportPadCompactName
import at.hannibal2.skyhanni.features.misc.teleportpad.TeleportPadInventoryNumber
import at.hannibal2.skyhanni.features.misc.tiarelay.TiaRelayHelper
@@ -343,6 +344,7 @@ class SkyHanniMod {
loadModule(ShowFishingItemName())
loadModule(WarpTabComplete)
loadModule(PlayerTabComplete)
+ loadModule(GfsTabComplete)
loadModule(SlayerItemProfitTracker)
loadModule(SlayerItemsOnGround())
loadModule(RestorePieceOfWizardPortalLore())
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java
index 945468fcb..2a9bce6bc 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java
@@ -540,6 +540,12 @@ public class MiscConfig {
@ConfigEditorBoolean
@FeatureToggle
public boolean vipVisits = true;
+
+ @Expose
+ @ConfigOption(name = "/gfs Sack", desc = "Tab complete /gfs sack items.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean gfsSack = true;
}
@ConfigOption(name = "Pocket Sack-In-A-Sack", desc = "")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GfsTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GfsTabComplete.kt
new file mode 100644
index 000000000..a702f9390
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/GfsTabComplete.kt
@@ -0,0 +1,27 @@
+package at.hannibal2.skyhanni.features.misc.tabcomplete
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.RepositoryReloadEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.jsonobjects.SackListJson
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+object GfsTabComplete {
+ private val config get() = SkyHanniMod.feature.misc.tabCompleteCommands
+ private var sackListJson: SackListJson? = null;
+ private val gfsCommands = arrayOf("gfs", "getfromsacks")
+
+ @SubscribeEvent
+ fun onRepoReload(event: RepositoryReloadEvent) {
+ sackListJson = event.getConstant<SackListJson>("Sacks")
+ }
+
+ fun handleTabComplete(command: String): List<String>? {
+ if (!isEnabled()) return null
+ if (command !in gfsCommands) return null
+
+ return sackListJson?.sackList
+ }
+
+ fun isEnabled() = LorenzUtils.inSkyBlock && config.gfsSack
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/TabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/TabComplete.kt
index 8e13d3a1d..b8bb64f57 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/TabComplete.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/TabComplete.kt
@@ -20,6 +20,7 @@ object TabComplete {
}
private fun customTabComplete(command: String): List<String>? {
+ GfsTabComplete.handleTabComplete(command)?.let { return it }
WarpTabComplete.handleTabComplete(command)?.let { return it }
PlayerTabComplete.handleTabComplete(command)?.let { return it }
CollectionTracker.handleTabComplete(command)?.let { return it }
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/SackListJson.java b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/SackListJson.java
new file mode 100644
index 000000000..c554ddb24
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/utils/jsonobjects/SackListJson.java
@@ -0,0 +1,11 @@
+package at.hannibal2.skyhanni.utils.jsonobjects;
+
+import com.google.gson.annotations.Expose;
+
+import java.util.List;
+
+public class SackListJson {
+
+ @Expose
+ public List<String> sackList;
+}