修复安装新实例时未将 patch 合并到主 manifest 中的问题 (#6718)

This commit is contained in:
Glavo authored and GitHub committed 2026-08-21 21:42:08 +08:00
1 parent c9585198e1
commit 083dbb18ad
4 files changed
+5 -3

No files matched your search

@@ -111,7 +111,7 @@ public class DefaultGameBuilder extends GameBuilder {
GameInstanceManifest.Resolved resolved = draft.getBaseSnapshot().resolve(manifest);
return new GameDownloadTask(dependencyManager, resolved.launchManifest())
.thenApplyAsync(minecraftJar -> {
draft.put(resolved.standaloneManifest());
draft.put(resolved.launchManifest().withPatches(manifest.patches()));
draft.putPrimaryJar(id, minecraftJar);
return draft.commit().getInstance(id);
});
@@ -638,8 +638,7 @@ public abstract class DefaultGameRepository implements GameRepository {
return Task.supplyAsync(() -> {
GameRepositoryDraft draft = openDraft();
active.set(draft);
GameInstance publishedInstance = getInstance(instanceId);
return publishedInstance;
return draft.getBaseSnapshot().getInstance(instanceId);
})
.thenComposeAsync(updater)
.thenApplyAsync(manifest -> {
@@ -91,6 +91,7 @@ public final class DefaultGameRepositoryDraft implements GameRepositoryDraft {
return repository;
}
@Override
public DefaultGameRepositorySnapshot getBaseSnapshot() {
return baseSnapshot;
}
@@ -63,6 +63,8 @@ public interface GameRepositoryDraft extends AutoCloseable {
/// @return the repository
GameRepository getRepository();
GameRepositorySnapshot getBaseSnapshot();
/// Returns this draft's lifecycle state.
///
/// @return the current state