修复数据包管理在低于1.13的版本意外出现的问题 (#4428)

This commit is contained in:
Wulian233 2025-09-13 20:33:22 +08:00 committed by GitHub
parent e7526e39bf
commit c2d5a07053
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,11 +68,6 @@ public final class WorldManagePage extends DecoratorAnimatedPage implements Deco
this.state = new SimpleObjectProperty<>(State.fromTitle(i18n("world.manage.title", world.getWorldName())));
this.header = new TabHeader(worldInfoTab, worldBackupsTab);
if (world.getGameVersion() != null && // old game will not write game version to level.dat
GameVersionNumber.compare(world.getGameVersion(), "1.13") >= 0) {
header.getTabs().add(datapackTab);
}
worldInfoTab.setNodeSupplier(() -> new WorldInfoPage(this));
worldBackupsTab.setNodeSupplier(() -> new WorldBackupsPage(this));
datapackTab.setNodeSupplier(() -> new DatapackListPage(this));
@ -90,8 +85,14 @@ public final class WorldManagePage extends DecoratorAnimatedPage implements Deco
AdvancedListBox sideBar = new AdvancedListBox()
.addNavigationDrawerTab(header, worldInfoTab, i18n("world.info"), SVG.INFO)
.addNavigationDrawerTab(header, worldBackupsTab, i18n("world.backup"), SVG.ARCHIVE)
.addNavigationDrawerTab(header, datapackTab, i18n("world.datapack"), SVG.EXTENSION);
.addNavigationDrawerTab(header, worldBackupsTab, i18n("world.backup"), SVG.ARCHIVE);
if (world.getGameVersion() != null && // old game will not write game version to level.dat
GameVersionNumber.asGameVersion(world.getGameVersion()).isAtLeast("1.13", "17w43a")) {
header.getTabs().add(datapackTab);
sideBar.addNavigationDrawerTab(header, datapackTab, i18n("world.datapack"), SVG.EXTENSION);
}
left.setTop(sideBar);
AdvancedListBox toolbar = new AdvancedListBox();