Skip to content

Commit

Permalink
Fix upgrade instructions for fallback world (closes Johni0702#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johni0702 committed Nov 13, 2022
1 parent b0f30bb commit eb3f305
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public static void closeAll() {
}

private final Path directory;
private final boolean writeable;
private final AtomicBoolean sentUpgradeNotification = new AtomicBoolean();
@Nullable
private final LastAccessFile lastAccess;
Expand All @@ -115,6 +116,7 @@ private FakeChunkStorage(Path directory, boolean writeable) {
super(directory, MinecraftClient.getInstance().getDataFixer(), false);

this.directory = directory;
this.writeable = writeable;

LastAccessFile lastAccess = null;
if (writeable) {
Expand Down Expand Up @@ -166,7 +168,7 @@ private NbtCompound loadTag(ChunkPos pos, NbtCompound nbt) {
if (sentUpgradeNotification.compareAndSet(false, true)) {
MinecraftClient client = MinecraftClient.getInstance();
client.submit(() -> {
Text text = Text.translatable("bobby.upgrade.required");
Text text = Text.translatable(writeable ? "bobby.upgrade.required" : "bobby.upgrade.fallback_world");
client.submit(() -> client.inGameHud.getChatHud().addMessage(text));
});
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/bobby/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"bobby.upgrade.required": "[Bobby] This world contains data from an old version of Minecraft. Run `/bobby upgrade` to upgrade it.",
"bobby.upgrade.fallback_world": "[Bobby] Your fallback world contains data from an old version of Minecraft. Upgrade it from the \"Singleplayer\" menu using the \"Edit\" -> \"Optimize World\" option.",
"bobby.upgrade.not_enabled": "Bobby is not enabled for this world.",
"bobby.upgrade.begin": "[Bobby] Upgrading world data to current Minecraft version. This may take a few minutes.",
"bobby.upgrade.progress": "[Bobby] Upgraded %d of (estimated) %d chunks.",
Expand Down

0 comments on commit eb3f305

Please sign in to comment.