diff --git a/xmcl-keystone-ui/src/composables/instanceOptions.ts b/xmcl-keystone-ui/src/composables/instanceOptions.ts index bd4446704..8ed31f29c 100644 --- a/xmcl-keystone-ui/src/composables/instanceOptions.ts +++ b/xmcl-keystone-ui/src/composables/instanceOptions.ts @@ -16,7 +16,6 @@ export function useInstanceOptions(instancePath: Ref) { editGameSetting({ instancePath: instancePath.value, lang: locale.value.toLowerCase().replace('-', '_'), - resourcePacks: newOps.resourcePacks, }) } } diff --git a/xmcl-runtime/instance/InstanceOptionsService.ts b/xmcl-runtime/instance/InstanceOptionsService.ts index 791d06c95..1f4ffdee5 100644 --- a/xmcl-runtime/instance/InstanceOptionsService.ts +++ b/xmcl-runtime/instance/InstanceOptionsService.ts @@ -100,7 +100,7 @@ export class InstanceOptionsService extends AbstractService implements IInstance loadOptions(path) } else if (basename(file) === ('optionsshaders.txt')) { loadShaderOptions(path) - } else if (event === 'unlinkDir' && file === path) { + } else if (event === 'unlinkDir' && !file) { dispose() } }).add('options.txt') diff --git a/xmcl-runtime/resourcePack/AbstractInstanceDoaminService.ts b/xmcl-runtime/resourcePack/AbstractInstanceDoaminService.ts index 3e55be7c0..753b6b7ad 100644 --- a/xmcl-runtime/resourcePack/AbstractInstanceDoaminService.ts +++ b/xmcl-runtime/resourcePack/AbstractInstanceDoaminService.ts @@ -125,6 +125,9 @@ export abstract class AbstractInstanceDomainService extends AbstractService { throw e }) if (fstat.isDirectory()) continue + const dstat = await stat(dest).catch(_ => undefined) + if (dstat?.ino === fstat.ino) continue + if (dstat?.size === fstat.size) continue result.push(await linkOrCopyFile(src, dest)) } return result diff --git a/xmcl-runtime/save/InstanceSavesService.ts b/xmcl-runtime/save/InstanceSavesService.ts index fe9e1caf5..57b6d5ff9 100644 --- a/xmcl-runtime/save/InstanceSavesService.ts +++ b/xmcl-runtime/save/InstanceSavesService.ts @@ -216,7 +216,7 @@ export class InstanceSavesService extends AbstractService implements IInstanceSa path: absPath, }) } - } else if (event === 'unlinkDir' && file === path) { + } else if (event === 'unlinkDir' && (file === path || !file)) { dispose() } })