aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-09-06 00:06:55 +0200
committerLinnea Gräf <nea@nea.moe>2025-09-06 00:06:55 +0200
commit45bda2c907b224e12c793be08ad0498487a52e6b (patch)
tree8def9dd24bbad7ca225e42a05c4d53b5bafd0775 /src/main/kotlin
parent722d78914b75901ae6c2729784330d45bc37625c (diff)
downloadFirmament-45bda2c907b224e12c793be08ad0498487a52e6b.tar.gz
Firmament-45bda2c907b224e12c793be08ad0498487a52e6b.tar.bz2
Firmament-45bda2c907b224e12c793be08ad0498487a52e6b.zip
fix(dev): hide non exported item highlights for items in old modern versions
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/features/debug/itemeditor/ItemExporter.kt17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt b/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
index 386a741..ccbd7e0 100644
--- a/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
+++ b/src/main/kotlin/features/debug/itemeditor/ItemExporter.kt
@@ -53,7 +53,10 @@ object ItemExporter {
var json = exporter.exportJson()
val fileName = json.jsonObject["internalname"]?.jsonPrimitive?.takeIf { it.isString }?.content
if (fileName == null) {
- return tr("firmament.repoexport.nointernalname", "Could not find internal name to export for this item (null.json)")
+ return tr(
+ "firmament.repoexport.nointernalname",
+ "Could not find internal name to export for this item (null.json)"
+ )
}
val itemFile = RepoDownloadManager.repoSavedLocation.resolve("items").resolve("${fileName}.json")
itemFile.createParentDirectories()
@@ -220,11 +223,13 @@ object ItemExporter {
val stack = event.slot.stack ?: return
val id = event.slot.stack.skyBlockId?.neuItem
if (PowerUserTools.TConfig.dontHighlightSemicolonItems && id != null && id.contains(";")) return
- val isExported = nonOverlayCache.getOrPut(stack.skyBlockId ?: return) {
- RepoDownloadManager.repoSavedLocation.resolve("itemsOverlay")
- .resolve(ExportedTestConstantMeta.current.dataVersion.toString())
- .resolve("${stack.skyBlockId}.snbt")
- .exists()
+ val sbId = stack.skyBlockId ?: return
+ val isExported = nonOverlayCache.getOrPut(sbId) {
+ RepoManager.overlayData.getOverlayFiles(sbId).isNotEmpty() || // This extra case is here so that an export works immediately, without repo reload
+ RepoDownloadManager.repoSavedLocation.resolve("itemsOverlay")
+ .resolve(ExportedTestConstantMeta.current.dataVersion.toString())
+ .resolve("${stack.skyBlockId}.snbt")
+ .exists()
}
if (!isExported)
event.context.drawGuiTexture(