aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
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/main/java/at/hannibal2/skyhanni/features
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/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt39
1 files changed, 24 insertions, 15 deletions
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