Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ${HOME}/.minecraft总是被无意义的创建并且持久化 #2970

Open
strayedstar opened this issue Apr 4, 2024 · 13 comments
Open
Labels

Comments

@strayedstar
Copy link

平台 | Platform

ALL

问题描述 | Problem Description

multimc及其延伸版本以及其他的一些启动器则不会乱创建,并且会在自己的工作目录创建该文件.
这个问题贯穿所有HMCL版本,window上用户目录不经常被显现使用因此这个几乎不是问题,但是在类unix系统上则是经常使用的.
修复这个问题可以使得环境更干净,而且并不是很难,至少别的启动器实现了,希望跟进一下.

启动器崩溃报告 / 启动器日志文件 | Launcher Crash Report / Launcher Log File

null

@strayedstar strayedstar added the bug label Apr 4, 2024
@LJS08
Copy link

LJS08 commented Apr 5, 2024

.minecraft 好像应该是会隐藏的吧?
(毕竟有个" . ")

@burningtnt
Copy link
Member

经过测试,当在版本列表中删除“官方启动器文件夹”时,用户目录下的 .minecraft 不再会被 HMCL 使用。
请前往版本列表操作左侧的游戏仓库

@burningtnt burningtnt closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
@strayedstar
Copy link
Author

strayedstar commented Apr 5, 2024

经过测试,当在版本列表中删除“官方启动器文件夹”时,用户目录下的 .minecraft 不再会被 HMCL 使用。 请前往版本列表操作左侧的游戏仓库

好吧,你是对的,但不完全对,这更加表明这是一个bug,当游戏使用相对目录.minecraft(实际在workdir下),还是会创建~/.minecraft文件夹,改为其他的名称则不会,但是!没有~/.minecraft文件夹(里面只有皮肤文件)会导致HMCL左边显示和进入游戏的皮肤异常!
强制刷新皮肤以后,皮肤正常了,但是~/.minecraft又回来了. 目录内容:assets/skins/91/$(皮肤的sha256值)

@strayedstar
Copy link
Author

经过测试,当在版本列表中删除“官方启动器文件夹”时,用户目录下的 .minecraft 不再会被 HMCL 使用。 请前往版本列表操作左侧的游戏仓库

也就是实际上是皮肤自动加载中不正确的路径(HMCL自身问题),导致~/.minecraft文件夹的出现.

平台:linux
启动脚本:#!/bin/bash
#jfx path
jfx=${HOME}/.local/lib/runtimes/java/jrefx11
#data path
dp=${HOME}/.local/apps/hmcl
#executable file
ELF=$dp/hmcl.jar
#network
export https_proxy=http://127.0.0.1:33389
export http_proxy=http://127.0.0.1:33389
export all_proxy=socks5://127.0.0.1:33389
#rm -rf ~/.minecraft
cd $dp #workdir
$jfx/bin/java -XX:+CMSConcurrentMTEnabled -XX:ParallelGCThreads=8 -XX:+UseAdaptiveSizePolicy --module-path $jfx/lib/javafx.base.jar:$jfx/lib/javafx.fxml.jar:$jfx/lib/javafx.graphics.jar:$jfx/lib/javafx.media.jar:$jfx/lib/javafx.swing.jar:$jfx/lib/javafx.web.jar:$jfx/lib/javafx.controls.jar --add-modules=javafx.base --add-modules=javafx.fxml --add-modules=javafx.graphics --add-modules=javafx.media --add-modules=javafx.swing --add-modules=javafx.web --add-modules=javafx.controls -Dhmcl.self_integrity_check.disable=true -Dhmcl.home=$dp -Dhmcl.authlibinjector.location=lib/authlib-injector.jar -Xmx256M -jar $ELF '$@'
#remove cache and old logs after close
mkdir -p ~/.cache/hmcl/{temp,saves}
ln -sf ~/.cache/hmcl/* ./
rm -rf temp/*
#remove old logs
rm -f logs/hmcl.log.*
#rm -rf ~/.minecraft

100%复现.

@burningtnt
Copy link
Member

没听懂,请详细描述一下

@burningtnt burningtnt reopened this Apr 5, 2024
@strayedstar
Copy link
Author

strayedstar commented Apr 5, 2024

没听懂,请详细描述一下

e,就是皮肤刷新必然会导致~/.minecraft的产生,目录的内容是assets/skins/91/$(皮肤的sha256值).
删除以后进游戏和HMCL的左侧栏头像显示都会异常.
HMCL:最新测试版

@strayedstar
Copy link
Author

strayedstar commented Apr 5, 2024

没听懂,请详细描述一下

直接上日志
[23:25:49] [org.jackhuang.hmcl.ui.construct.Navigator.navigate/INFO] Navigate to AccountListPage@7eed7b29[styleClass=gray-background]
[23:25:49] [org.jackhuang.hmcl.auth.microsoft.MicrosoftService.lambda$new$0/INFO] Fetching properties of 7421459f-8587-4a89-9ba6-cd3218de132e
[23:25:50] [org.jackhuang.hmcl.task.Task.run/TRACE] Executing task: hash
[23:25:50] [org.jackhuang.hmcl.task.Task.run/TRACE] Executing task: hash
[23:25:50] [org.jackhuang.hmcl.task.FileDownloadTask.beforeDownload/TRACE] Downloading http://textures.minecraft.net/texture/hash to ${HOME}/.minecraft/assets/skins/91/hash
[23:25:50] [org.jackhuang.hmcl.task.FileDownloadTask.beforeDownload/TRACE] Downloading http://textures.minecraft.net/texture/hash to ${HOME}/.minecraft/assets/skins/91/hash
[23:25:50] [org.jackhuang.hmcl.game.TexturesLoader.loadTexture/INFO] Texture downloaded: http://textures.minecraft.net/texture/hash
[23:25:50] [org.jackhuang.hmcl.game.TexturesLoader.loadTexture/INFO] Texture downloaded: http://textures.minecraft.net/texture/hash
家目录的绝对地址显示已经替换为${HOME},皮肤的hash已改为hash
睡觉去了,明天还要上学.

@zkitefly
Copy link
Member

zkitefly commented Apr 5, 2024

确实是这样,我记得无论哪个平台都会这样?

@burningtnt
Copy link
Member

看起来确实是个 Bug,我们会处理的

@burningtnt
Copy link
Member

哦,这个是因为 HMCL 需要找个地方保存你的皮肤 ———— 不然你的皮肤预览功能每次都得去拉取

@burningtnt
Copy link
Member

如果改成其他的(比如直接放到你当前选中的那个游戏目录里),虽说是可以的,但会导致更多的问题…… 所以就这样吧。实在不行你就把那个文件隐藏了

@burningtnt burningtnt closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2024
@strayedstar
Copy link
Author

如果改成其他的(比如直接放到你当前选中的那个游戏目录里),虽说是可以的,但会导致更多的问题…… 所以就这样吧。实在不行你就把那个文件隐藏了

所以可以通过一个环境变量指示或者使用游戏工作目录?或者在Linux构建上保存到~/.cache目录?

我现在通过bwrap“解决”了这个问题,不过要是原生支持就更好了。毕竟相关修改只要不超过5行的主要代码。

@burningtnt burningtnt reopened this May 7, 2024
@burningtnt
Copy link
Member

reopen,这个问题还是有必要解决的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants