aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-26 13:26:51 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-26 13:26:51 +0200
commit7944f8f88ec20b8caea0c41757366734682e059d (patch)
tree8039e038dedbf759c94897970bff6164f5c0684a /src
parentc630877d373f1e2313cd2fa78df7130dff3d7382 (diff)
downloadskyhanni-7944f8f88ec20b8caea0c41757366734682e059d.tar.gz
skyhanni-7944f8f88ec20b8caea0c41757366734682e059d.tar.bz2
skyhanni-7944f8f88ec20b8caea0c41757366734682e059d.zip
Added command /shclearminiondata - Manually reset all private island minion location data.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt39
2 files changed, 26 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index 452b038e7..259beee57 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.features.garden.GardenCropTimeCommand
import at.hannibal2.skyhanni.features.garden.composter.ComposterOverlay
import at.hannibal2.skyhanni.features.garden.farming.CropSpeedMeter
+import at.hannibal2.skyhanni.features.minion.MinionFeatures
import at.hannibal2.skyhanni.features.misc.CollectionCounter
import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager
import at.hannibal2.skyhanni.test.LorenzTest
@@ -61,6 +62,7 @@ object Commands {
registerCommand("shcroptime") { GardenCropTimeCommand.onCommand(it) }
registerCommand("shtestcomposter") { ComposterOverlay.onCommand(it) }
registerCommand("shclearcropspeed") { GardenAPI.clearCropSpeed() }
+ registerCommand("shclearminiondata") { MinionFeatures.clearMinionData() }
}
private fun registerCommand(name: String, function: (Array<String>) -> Unit) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
index d04372b32..382a3d8ed 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt
@@ -37,7 +37,6 @@ class MinionFeatures {
private var lastCoinsRecived = 0L
private var lastMinionPickedUp = 0L
- private val minions = mutableMapOf<LorenzVec, MinionData>()
private var coinsPerDay = ""
private val minionUpgradePattern = "§aYou have upgraded your Minion to Tier (.*)".toPattern()
@@ -179,20 +178,6 @@ class MinionFeatures {
return "§7Coins/day with $hopperName§7: §6$format coins"
}
- private fun saveConfig() {
- val minionConfig = SkyHanniMod.feature.hidden.minionLastClick
- val minionName = SkyHanniMod.feature.hidden.minionName
-
- minionConfig.clear()
- minionName.clear()
- for (minion in minions) {
- val coordinates = minion.key.encodeToString()
- val data = minion.value
- minionConfig[coordinates] = data.lastClicked
- minionName[coordinates] = data.displayName
- }
- }
-
@SubscribeEvent
fun onWorldChange(event: WorldEvent.Load) {
lastClickedEntity = null
@@ -283,4 +268,28 @@ class MinionFeatures {
config.hopperProfitPos.renderString(coinsPerDay, posLabel = "Minion Coins Per Day")
}
}
+
+ companion object {
+ private val minions = mutableMapOf<LorenzVec, MinionData>()
+
+ fun clearMinionData() {
+ minions.clear()
+ saveConfig()
+ LorenzUtils.chat("§e[SkyHanni] Manually reset all private island minion location data!")
+ }
+
+ private fun saveConfig() {
+ val minionConfig = SkyHanniMod.feature.hidden.minionLastClick
+ val minionName = SkyHanniMod.feature.hidden.minionName
+
+ minionConfig.clear()
+ minionName.clear()
+ for (minion in minions) {
+ val coordinates = minion.key.encodeToString()
+ val data = minion.value
+ minionConfig[coordinates] = data.lastClicked
+ minionName[coordinates] = data.displayName
+ }
+ }
+ }
} \ No newline at end of file