aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-07 13:28:40 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-07 13:28:40 +0200
commitfc37164d0c197a4702c2b73006052a2cedcd1294 (patch)
tree0649279427b0e32d322ed555cca68d382e5bf3fc
parent33ac10175c2e90db87ca63c3a1ff4eda79ce7588 (diff)
downloadskyhanni-fc37164d0c197a4702c2b73006052a2cedcd1294.tar.gz
skyhanni-fc37164d0c197a4702c2b73006052a2cedcd1294.tar.bz2
skyhanni-fc37164d0c197a4702c2b73006052a2cedcd1294.zip
Fixed End Node Tracker not updating when changing the text format
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt7
2 files changed, 7 insertions, 2 deletions
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 81818dca6..eb7b5d2c6 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java
@@ -628,7 +628,7 @@ public class MiscConfig {
" "
}
)
- public List<Integer> textFormat = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16, 17, 23));
+ public Property<List<Integer>> textFormat = Property.of(new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15, 16, 17, 23)));
@Expose
public Position position = new Position(10, 80, false, true);
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt
index 90c00bdad..1ecb6f5d8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/EnderNodeTracker.kt
@@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.events.PlaySoundEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList
+import at.hannibal2.skyhanni.utils.LorenzUtils.afterChange
import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
@@ -99,6 +100,10 @@ class EnderNodeTracker {
@SubscribeEvent
fun onConfigLoad(event: ConfigLoadEvent) {
+ config.textFormat.afterChange {
+ saveAndUpdate()
+ }
+
val hidden = ProfileStorageData.profileSpecific?.enderNodeTracker ?: return
totalNodesMined = hidden.totalNodesMined
totalEndermiteNests = hidden.totalEndermiteNests
@@ -191,7 +196,7 @@ class EnderNodeTracker {
private fun formatDisplay(map: List<List<Any>>): List<List<Any>> {
val newList = mutableListOf<List<Any>>()
- for (index in config.textFormat) {
+ for (index in config.textFormat.get()) {
newList.add(map[index])
}
return newList