diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-09 12:12:27 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-09 12:12:27 +0200 |
commit | 17ec026c19d1e203244217d599f72bd265d9aac8 (patch) | |
tree | 28c86ae9415e11ec316741ba752a7e807a10f74c /src/main/java/at/hannibal2/skyhanni/config | |
parent | 3bcd5b3a8afa5b322d75af1b82681fd7b1e494e5 (diff) | |
download | skyhanni-17ec026c19d1e203244217d599f72bd265d9aac8.tar.gz skyhanni-17ec026c19d1e203244217d599f72bd265d9aac8.tar.bz2 skyhanni-17ec026c19d1e203244217d599f72bd265d9aac8.zip |
Using NEUInternalName in slayer profit tracker
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt | 10 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/Storage.java | 11 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt index 7eeffb9a4..1e1ec683a 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.features.misc.update.UpdateManager import at.hannibal2.skyhanni.utils.LorenzLogger import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUItems import com.google.gson.GsonBuilder import com.google.gson.TypeAdapter @@ -65,6 +66,15 @@ class ConfigManager { return NEUItems.loadNBTData(reader.nextString()) } }.nullSafe()) + .registerTypeAdapter(NEUInternalName::class.java, object : TypeAdapter<NEUInternalName>() { + override fun write(out: JsonWriter, value: NEUInternalName) { + out.value(value.asString()) + } + + override fun read(reader: JsonReader): NEUInternalName { + return NEUInternalName.from(reader.nextString()) + } + }.nullSafe()) .enableComplexMapKeySerialization() .create() } diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index 080b77ce8..f5e6bdce2 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -11,14 +11,11 @@ import at.hannibal2.skyhanni.features.misc.FrozenTreasure; import at.hannibal2.skyhanni.features.misc.ghostcounter.GhostData; import at.hannibal2.skyhanni.features.rift.area.westvillage.KloonTerminal; import at.hannibal2.skyhanni.utils.LorenzVec; +import at.hannibal2.skyhanni.utils.NEUInternalName; import com.google.gson.annotations.Expose; import net.minecraft.item.ItemStack; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; public class Storage { @@ -297,7 +294,7 @@ public class Storage { public static class SlayerProfitList { @Expose - public Map<String, SlayerItemProfit> items = new HashMap<>(); + public Map<NEUInternalName, SlayerItemProfit> items = new HashMap<>(); @Expose public long mobKillCoins = 0; @@ -310,7 +307,7 @@ public class Storage { public static class SlayerItemProfit { @Expose - public String internalName; + public NEUInternalName internalName; @Expose public long timesDropped; @Expose |