aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-05-04 15:34:02 +0200
committernea <nea@nea.moe>2023-05-04 15:34:02 +0200
commitbcd86e28228d2ee35a2009d4f7e2fea55ea3c02f (patch)
tree0a6e2e8551900b5f5b3f0e178e58873a8c68a146 /src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt
parent857427b0766fe68590589c22e86dbcf1196b4ed5 (diff)
downloadfirmament-bcd86e28228d2ee35a2009d4f7e2fea55ea3c02f.tar.gz
firmament-bcd86e28228d2ee35a2009d4f7e2fea55ea3c02f.tar.bz2
firmament-bcd86e28228d2ee35a2009d4f7e2fea55ea3c02f.zip
Display broken favourites
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt b/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt
index 97082e2..b6c81a7 100644
--- a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt
+++ b/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt
@@ -8,16 +8,18 @@ import moe.nea.notenoughupdates.repo.RepoManager
import moe.nea.notenoughupdates.util.SkyblockId
object NEUItemEntrySerializer : EntrySerializer<NEUItem?> {
+ const val SKYBLOCK_ID_ENTRY = "SKYBLOCK_ID"
+
override fun supportSaving(): Boolean = true
override fun supportReading(): Boolean = true
override fun read(tag: NbtCompound): NEUItem? {
- return RepoManager.getNEUItem(SkyblockId(tag.getString("SKYBLOCK_ID")))
+ return RepoManager.getNEUItem(SkyblockId(tag.getString(SKYBLOCK_ID_ENTRY)))
}
override fun save(entry: EntryStack<NEUItem?>, value: NEUItem?): NbtCompound {
return NbtCompound().apply {
- putString("SKYBLOCK_ID", value?.skyblockItemId ?: "null")
+ putString(SKYBLOCK_ID_ENTRY, value?.skyblockItemId ?: "null")
}
}
}