Skip to content

Commit 3adf60b

Browse files
committed
1.13.1
1 parent cf7c4e5 commit 3adf60b

5 files changed

Lines changed: 66 additions & 5 deletions

File tree

CHANGELOG-LATEST.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
### Added
22

3-
- Added support for NBT-based entries.
3+
- Added `/fieldguide export missing` to export missing descriptions as lang entries.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.13.1] - 2026-07-01
9+
10+
### Added
11+
12+
- Added `/fieldguide export missing` to export missing descriptions as lang entries.
13+
814
## [1.13.0] - 2026-06-25
915

1016
### Added

common/src/main/java/com/evandev/fieldguide/client/progress/ProgressManager.java

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
import com.evandev.fieldguide.Constants;
44
import com.evandev.fieldguide.FieldGuideLimits;
5+
import com.evandev.fieldguide.api.EntryVariantData;
6+
import com.evandev.fieldguide.api.GuideEntry;
57
import com.evandev.fieldguide.client.ClientFieldGuideManager;
68
import com.evandev.fieldguide.client.data.JournalPage;
79
import com.evandev.fieldguide.client.gui.toasts.FieldGuideToast;
810
import com.evandev.fieldguide.client.gui.util.IconCacheManager;
11+
import com.evandev.fieldguide.client.manager.ClientTextManager;
912
import com.evandev.fieldguide.config.ClientConfig;
1013
import com.evandev.fieldguide.entry.EntryResolver;
1114
import com.evandev.fieldguide.network.MarkSeenPacket;
@@ -465,8 +468,11 @@ public void exportToLang(String type) {
465468

466469
private @NotNull JsonObject getLangJson(String type) {
467470
JsonObject langJson = new JsonObject();
471+
Map<String, String> sortedEntries = new TreeMap<>();
472+
468473
boolean exportNames = type.equals("names") || type.equals("all");
469474
boolean exportDesc = type.equals("descriptions") || type.equals("all");
475+
boolean exportMissing = type.equals("missing");
470476

471477
if (exportNames) {
472478
for (Map.Entry<String, String> entry : customNames.entrySet()) {
@@ -478,9 +484,9 @@ public void exportToLang(String type) {
478484

479485
if (parts.length > 1) { // variant
480486
String variantSuffix = parts[1].toLowerCase(Locale.ROOT);
481-
langJson.addProperty("fieldguide.name." + entryType + "." + path + "." + variantSuffix, entry.getValue());
487+
sortedEntries.put("fieldguide.name." + entryType + "." + path + "." + variantSuffix, entry.getValue());
482488
} else { // base entity
483-
langJson.addProperty("fieldguide.name." + entryType + "." + path, entry.getValue());
489+
sortedEntries.put("fieldguide.name." + entryType + "." + path, entry.getValue());
484490
}
485491
}
486492
}
@@ -493,9 +499,57 @@ public void exportToLang(String type) {
493499
String path = prefixedId.getPath().replace('/', '.');
494500

495501
String variantSuffix = parts.length > 1 ? "." + parts[1].toLowerCase(Locale.ROOT) : "";
496-
langJson.addProperty("fieldguide." + entryType + "." + path + variantSuffix + ".description", entry.getValue());
502+
sortedEntries.put("fieldguide." + entryType + "." + path + variantSuffix + ".description", entry.getValue());
503+
}
504+
}
505+
if (exportMissing) {
506+
String missingDesc = I18n.get("fieldguide.description.missing");
507+
String missingName = I18n.get("fieldguide.unknown");
508+
509+
for (Object entry : ClientFieldGuideManager.getValidEntries()) {
510+
ResourceLocation id = ClientFieldGuideManager.getEntryId(entry);
511+
if (id == null) continue;
512+
513+
ResourceLocation prefixedId = EntryResolver.getEntryId(entry, true);
514+
if (prefixedId == null) prefixedId = id;
515+
516+
String entryType = prefixedId.getNamespace();
517+
String path = prefixedId.getPath().replace('/', '.');
518+
519+
String nameKey = "fieldguide.name." + entryType + "." + path;
520+
String descKey = "fieldguide." + entryType + "." + path + ".description";
521+
522+
if (ClientTextManager.getInstance().getDefaultNameComponent(entry).getString().equals(missingName)) {
523+
sortedEntries.put(nameKey, "");
524+
}
525+
526+
if (ClientTextManager.getInstance().getEntryDescription(entry).equals(missingDesc)) {
527+
sortedEntries.put(descKey, "");
528+
}
529+
530+
if (entry instanceof GuideEntry ge && ge.hasVisualVariants()) {
531+
for (EntryVariantData variant : ge.visualVariants()) {
532+
String varId = variant.variantId();
533+
String varStr = varId.toLowerCase(Locale.ROOT);
534+
535+
String varNameKey = "fieldguide.name." + entryType + "." + path + "." + varStr;
536+
String varDescKey = "fieldguide." + entryType + "." + path + "." + varStr + ".description";
537+
538+
if (ClientTextManager.getInstance().getDefaultNameComponent(entry, varId).getString().equals(missingName)) {
539+
sortedEntries.put(varNameKey, "");
540+
}
541+
if (ClientTextManager.getInstance().getEntryDescription(entry, varId).equals(missingDesc)) {
542+
sortedEntries.put(varDescKey, "");
543+
}
544+
}
545+
}
497546
}
498547
}
548+
549+
for (Map.Entry<String, String> mapEntry : sortedEntries.entrySet()) {
550+
langJson.addProperty(mapEntry.getKey(), mapEntry.getValue());
551+
}
552+
499553
return langJson;
500554
}
501555
}

common/src/main/java/com/evandev/fieldguide/server/command/FieldGuideCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
5353
.then(Commands.literal("names").executes(ctx -> export(ctx.getSource(), "names")))
5454
.then(Commands.literal("descriptions").executes(ctx -> export(ctx.getSource(), "descriptions")))
5555
.then(Commands.literal("all").executes(ctx -> export(ctx.getSource(), "all")))
56+
.then(Commands.literal("missing").executes(ctx -> export(ctx.getSource(), "missing")))
5657
.then(Commands.literal("feature")
5758
.then(Commands.argument("feature", ResourceLocationArgument.id())
5859
.suggests((ctx, builder) -> SharedSuggestionProvider.suggestResource(

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Project
2-
version=1.13.0
2+
version=1.13.1
33
group=com.evandev.fieldguide
44
java_version=21
55

0 commit comments

Comments
 (0)