Skip to content

Commit 097235c

Browse files
committed
fix: 修复错误
1 parent 9655759 commit 097235c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldManagePage.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ public WorldManagePage(World world, Path backupsDir, Profile profile, String id)
7878
this.header = new TabHeader(transitionPane, worldInfoTab, worldBackupsTab);
7979
header.select(worldInfoTab);
8080

81+
// Does it need to be done in the background?
82+
try {
83+
sessionLockChannel = world.lock();
84+
LOG.info("Acquired lock on world " + world.getFileName());
85+
} catch (IOException ignored) {
86+
}
87+
8188
setCenter(transitionPane);
8289

8390
BorderPane left = new BorderPane();
@@ -100,7 +107,7 @@ public WorldManagePage(World world, Path backupsDir, Profile profile, String id)
100107
AdvancedListBox toolbar = new AdvancedListBox();
101108

102109
if (world.getWorldName() != null && GameVersionNumber.asGameVersion(world.getGameVersion()).isAtLeast("1.20", "23w14a")) {
103-
toolbar.addNavigationDrawerItem(i18n("version.launch_and_enter_world"), SVG.PLAY_ARROW,this::launch,advancedListItem -> advancedListItem.setDisable(isReadOnly()));
110+
toolbar.addNavigationDrawerItem(i18n("version.launch_and_enter_world"), SVG.PLAY_ARROW, this::launch, advancedListItem -> advancedListItem.setDisable(isReadOnly()));
104111
}
105112

106113
if (ChunkBaseApp.isSupported(world)) {
@@ -128,13 +135,6 @@ public WorldManagePage(World world, Path backupsDir, Profile profile, String id)
128135

129136
BorderPane.setMargin(toolbar, new Insets(0, 0, 12, 0));
130137
left.setBottom(toolbar);
131-
132-
// Does it need to be done in the background?
133-
try {
134-
sessionLockChannel = world.lock();
135-
LOG.info("Acquired lock on world " + world.getFileName());
136-
} catch (IOException ignored) {
137-
}
138138
}
139139

140140
@Override

0 commit comments

Comments
 (0)