Giter Site home page Giter Site logo

mrshieh-x / console-minecraft-launcher Goto Github PK

View Code? Open in Web Editor NEW
148.0 3.0 7.0 42.08 MB

一个在命令行上运行的 Minecraft Java 版启动器 A Minecraft Java Edition Launcher Running on the Command Line

Home Page: https://www.bilibili.com/video/BV1bY411R7wa/

License: GNU General Public License v3.0

Java 97.22% C 0.23% PowerShell 0.79% C++ 1.76%
console mc minecraft minecraft-launcher command mclauncher

console-minecraft-launcher's Introduction

Console Minecraft Launcher

一个在命令行上运行的 Minecraft Java 版启动器

最新版本 发布日期 软件需求

🎬 视频教程

中文:[CMCL2.0]命令行版MC启动器, 支持正版登录|外置登录|统一通行证|模组/整合包搜索安装|自定义皮肤披风
英语:[CMCL2.0]MC Launcher operates by command, supports Microsoft login|authlib-injector|nide8auth|mod/modpack searching and installation|custom skin and cape
如果你观看完视频后或使用时仍然有任何问题,可以参考疑难解答或通过在关于作者中找到的作者联系信息向作者提出疑问。

🏆 特别鸣谢

📕 使用教程

  • 如果您的操作系统是 Windows,则可以在 Releases 中下载cmcl.exe,然后打开 cmd,使用cd /d <目录路径>打开cmcl.exe所在的目录,执行命令cmcl,后面加上选项与参数。如果想要在任意目录都能使用CMCL,请参考疑难解答中的“怎么做到在任何路径下都能用CMCL?”
  • 如果您的操作系统是 ArchLinux,您可以使用yay安装CMCL,命令如下:
yay -S cmcl

然后直接输入命令cmcl即可,后面加上选项与参数。

  • 如果您的操作系统是 macOS,您可以使用 Homebrew 进行安装CMCL,命令如下:
brew tap MrShieh-X/brew
brew install cmcl

然后直接输入命令cmcl即可,后面加上选项与参数。
更新启动器的命令为:

brew update
brew upgrade cmcl

卸载的命令为:

brew uninstall cmcl
  • 如果您是其他 Linux 用户,或者您是 macOS 用户,但不希望使用 Homebrew 进行安装,您可以在 Releases 中找到最新版本,下载cmcl,然后在终端打开cmcl所在的目录,执行./cmcl,后面加上选项与参数即可。
  • 如果以上方法都不适用于您,您可以在 Releases 中找到最新版本,下载cmcl.jar,然后在终端(或 Windows 下的 cmd)打开cmcl.jar所在的目录,执行以下命令,后面加上选项与参数。这种方法在多数操作系统中都可用。
java -jar cmcl.jar

具体使用方法,请查阅帮助文档。 如果你想对启动器的配置进行修改,请查阅配置

📖 帮助文档

通过cmcl -hcmcl --help获得总帮助文档
获得单个功能的帮助文档,在功能选项后面加 -h--help,如cmcl account --help
注:中括号内的内容是可选的。选项中的逗号意为两边的选项都能实现相同的功能。
对于给选项指定内容,仅能在缩略选项(一条横杠)后面直接加上内容(无需空格),如cmcl -lD:\.minecraft
仅能在完整选项(两条横杠)后面加上等号再输入内容,如cmcl --list=D:\.minecraft
或在此两者后加上空格再输入内容,如cmcl -l D:\.minecraftcmcl --list D:\.minecraft,详细请参考选项说明后面的例子。
对于某些可能要经常输入的命令,可设置简化命令,详见疑难解答中的“能为经常输入的命令搞个‘快捷方式’吗?”

🔧 配置

配置存储在程序运行目录(在 Linux 与 macOS 下则为 用户目录/.config/cmcl)的一个名为cmcl.json的JSON文件,你可以使用文本编辑器(需了解JSON教程,建议修改前备份)或config <配置名称> <配置值>的程序参数(详见帮助文档配置相关)以修改配置。
使用文本编辑器编辑的话,配置名称以及文本配置值需要在英语的双引号("")内。
使用命令来修改时,如果配置值包含空格,则需要使用英语的双引号("")括起来
以下表格可通过参数config --view查看。
注:类型为布尔值的配置,它的值可以输入表示“是”的true,也可以是表示“否”的false

配置名 类型 含义
accounts JSON数组 账号(非直接修改,请通过“account -h”获得相关使用教程以进行修改)
downloadSource 整数 下载源,0为官方,1为BMCLAPI
language 文本 语言,zh为简体中文,en为英文,cantonese是粤语(简体)
selectedVersion 文本 已选择的版本,可直接使用“cmcl”进行启动
maxMemory 整数 [游戏相关]最大内存(单位:MB)
gameDir 文本 [游戏相关]自定义游戏目录路径(或设置版本隔离),默认为.minecraft
assetsDir 文本 [游戏相关]自定义assets资源目录路径,若为空则为游戏目录内的assets目录
resourcesDir 文本 [游戏相关]自定义资源包目录路径,若为空则为游戏目录内的resourcepacks目录
javaPath 文本 [游戏相关]Java 路径(如果为空会自动获得)
windowSizeWidth 整数 [游戏相关]游戏窗口的宽
windowSizeHeight 整数 [游戏相关]游戏窗口的高
isFullscreen 布尔值 [游戏相关]游戏窗口是否为全屏
exitWithMinecraft 布尔值 [游戏相关]运行游戏时,是否需要退出启动器时顺便退出游戏
printStartupInfo 布尔值 [游戏相关]开始游戏的时候,是否输出启动信息(Java 路径、最大内存等)
checkAccountBeforeStart 布尔值 [游戏相关]开始游戏之前,是否检查账号是否可用
jvmArgs JSON数组 [游戏相关]自定义JVM参数(查看下方的示例或通过“jvmArgs -h”获得相关使用教程以进行修改)
gameArgs JSON对象 [游戏相关]自定义游戏参数(查看下方的示例或通过“gameArgs -h”获得相关使用教程以进行修改)
qpLogFile 文本 [游戏相关]快速游玩(Quick Play,Minecraft 1.20 的新功能,设置下面三项配置即可启动游戏后分别直接进入存档、服务器、领域,只能设置一项)的日志文件路径(相对于游戏目录),可选
qpSaveName 文本 [游戏相关]快速游玩直接进入的存档名称
qpServerAddress 文本 [游戏相关]快速游玩直接进入的服务器地址(包括端口),该配置也适用于1.20之前的版本
qpRealmsID 文本 [游戏相关]快速游玩直接进入的领域ID
proxyEnabled 布尔值 是否开启网络代理
proxyHost 文本 代理主机地址
proxyPort 整数 代理端口
proxyUsername 文本 代理验证的账户(代理可选)
proxyPassword 文本 代理验证的密码(代理可选)
modDownloadSource 文本 模组下载源,curseforge或modrinth
modpackDownloadSource 文本 整合包下载源,curseforge或modrinth
simplifyCommands JSON对象 简化命令(通过“simplify -h”获得相关使用教程以进行修改)
jvmArgs 示例
["-Dfile.encoding=UTF-8", "-Djava.library.path=natives", "-XX:+PrintGC"]

以上内容意为设置-Dfile.encoding=UTF-8-Djava.library.path=natives以及-XX:+PrintGC的参数。

gameArgs 示例
{
  "fullscreen": "",
  "arg1": "value1",
  "arg2": "value2",
  "arg3": "space value3"
}

以上内容将会加入游戏参数--fullscreen --arg1 value1 --arg2 value2 --arg3 "space value3"

🌏 支持的界面语言

通过cmcl config language <语言代号>切换语言。

语言 语言代号
英语 en
简体中文 zh
粤语(简体) cantonese

©️ 版权

MrShiehX 拥有该程序的版权。
任何人都可以对此程序提出意见和建议。

📄 软件协议

该软件在 GPL v3 下分发,附带附加条款。

Console Minecraft Launcher
Copyright (C) 2021-2024  MrShiehX

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your function) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

📑 附加条款(依据 GPLv3 协议第七条)

不得移除本程序所显示的版权声明。[依据 GPLv3, 7(b).]

📢 免责声明

  • Minecraft 版权归 Mojang Studios 与 Microsoft 所有,使用CMCL产生的所有版权问题,软件制作方概不负责,请支持正版。
  • 用户因使用CMCL而产生的一切后果由用户自己承担,任何涉及CMCL的法律纠纷与冲突与开发者无关,CMCL与开发者将不承担任何责任。

🎓 关于作者

MrShiehX

如果您在CMCL发现任何BUG,或者有新的想法,欢迎在哔哩哔哩私信留言或提出 Issue

console-minecraft-launcher's People

Contributors

0xpte4r6 avatar mrshieh-x avatar xin-sin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

console-minecraft-launcher's Issues

[Problem] 关于外置登录一个账号对应多个角色的问题

CMCL版本

CMCL 1.1

皮肤站版本

Blessing Skin 6.0.0-rc2
理论上支持一个账号多角色的应该都有这个问题

问题描述

对于支持一个账号支持多个角色的外置登录皮肤站,在使用cmcl进行外置登陆时无法指定角色而导致失败

问题复现

  1. 选择一个皮肤站,在同一账号下创建>2的角色数量
  2. 在cmcl上使用邮箱或者指定用户名进行外置登录 cmcl -account -l -a -d "https://<皮肤站域名>/api/yggdrasil"
  3. 报错:登录失败,请选择一个可用的角色后重试。

关于配置文件的路径

目前程序默认会在运行目录下创建cmcl.json 但对于Linux来说 在家目录生成文件到底是不太雅观的
可以增加一个指定配置文件的选项
建议将linux平台的默认行为改为在$HOME/.config目录下创建与读取配置文件,在$HOME/.config/cmcl.json下不存在时 检测$HOME/.cmcl.json和当前运行目录下的cmcl.json 若均不存在 则创建$HOME/.config/cmcl.json
这样会更方便些

关于版本隔离

rt.
无论是在安装版本时直接安装modloader再设置版本隔离, 还是在安装版本后设置版本隔离再安装modloader, modloader都无法正常生效.
使用#11 (comment)中的方法也无法使modloader生效.
经测试, 目前已知唯一能使版本隔离与modloader共同生效的方法是导入带有modloader的整合包.
以上.

启动时报错无法启动

当我刚从CurseForge上下载好1.19.2的整合包,然后准备启动时出现以下错误

Starting game...
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-exports
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-opens
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-opens
Exception in thread "main" java.lang.ExceptionInInitializerError
        at cpw.mods.niofs.union.UnionFileSystemProvider.newFileSystemInternal(UnionFileSystemProvider.java:115)
        at cpw.mods.niofs.union.UnionFileSystemProvider.newFileSystem(UnionFileSystemProvider.java:105)
        at cpw.mods.jarhandling.impl.Jar.<init>(Jar.java:84)
        at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:70)
        at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:66)
        at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:58)
        at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:50)
        at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:84)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field static final java.lang.invoke.MethodHandles$Lookup java.lang.invoke.MethodHandles$Lookup.IMPL_LOOKUP accessible: module java.base does not "opens java.lang.invoke" to unnamed module @4fccd51b
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
        at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
        at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
        at cpw.mods.niofs.union.UnionFileSystem.<clinit>(UnionFileSystem.java:45)
        ... 8 more
Game finished

无法启动安装好的1.19

启动后出现这样的情况:找不到原生依赖库(natives)目录或为空,您需要使用“-version -n <版本名称>”下载原生依赖库文件以启动游戏。按照指示来做后依然不行

使用一段时间后登录多人服务器错误

操作系统:macOS 14.0
登录方式:微软登录
版本:1.20.1
描述:使用一段时间后登录多人服务器提示“无法连接至服务器,登录失败:无效会话(请尝试重启游戏及启动器)”
出现该问题后,通常需要重新登录微软账号才能进入
日志:
(base) ➜ cmcl java -jar cmcl.jar 1.20.1
启动版本:1.20.1 (1.20.1) | 登录账号:F1Justin (微软账户) | Java 路径:/Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home/bin/java
游戏跟随启动器退出:true | 全屏:false | 最大内存:8192MB | 窗口宽:854 | 窗口高:480 | 启动前检查账号:false
游戏目录:/Users/justin/cmcl/.minecraft

启动游戏中...
[18:16:27] [Datafixer Bootstrap/INFO]: 188 Datafixer optimizations took 57 milliseconds
[18:16:28] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[18:16:28] [Render thread/ERROR]: Failed to verify authentication
com.mojang.authlib.exceptions.InvalidCredentialsException: Status: 401
at com.mojang.authlib.exceptions.MinecraftClientHttpException.toAuthenticationException(MinecraftClientHttpException.java:56) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:156) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.(YggdrasilUserApiService.java:55) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.createUserApiService(YggdrasilAuthenticationService.java:124) ~[authlib-4.0.43.jar:?]
at enn.a(SourceFile:733) ~[1.20.1.jar:?]
at enn.(SourceFile:442) ~[1.20.1.jar:?]
at net.minecraft.client.main.Main.main(SourceFile:211) ~[1.20.1.jar:?]
Caused by: com.mojang.authlib.exceptions.MinecraftClientHttpException: Status: 401
at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:85) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:48) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:129) ~[authlib-4.0.43.jar:?]
... 5 more
[18:16:28] [Render thread/INFO]: Setting user: F1Justin
[18:16:28] [Render thread/INFO]: Backend library: LWJGL version 3.3.1 build 7
[18:16:28] [Render thread/INFO]: [STDERR]: [LWJGL] [ThreadLocalUtil] Unsupported JNI version detected, this may result in a crash. Please inform LWJGL developers.
[18:16:29] [Worker-Main-3/ERROR]: Failed to retrieve profile key pair
java.io.IOException: Could not retrieve profile key pair
at fes.a(SourceFile:139) ~[1.20.1.jar:?]
at fes.b(SourceFile:79) ~[1.20.1.jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
[18:16:29] [Render thread/INFO]: Reloading ResourceManager: vanilla
[18:16:29] [Worker-Main-4/INFO]: Found unifont_all_no_pua-15.0.06.hex, loading
[18:16:30] [Render thread/WARN]: Missing sound for event: minecraft:item.goat_horn.play
[18:16:30] [Render thread/WARN]: Missing sound for event: minecraft:entity.goat.screaming.horn_break
[18:16:30] [Render thread/INFO]: OpenAL initialized on device CoreAudio Default
[18:16:30] [Render thread/INFO]: Sound engine started
[18:16:30] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas
[18:16:30] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/signs.png-atlas
[18:16:30] [Render thread/INFO]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
[18:16:30] [Render thread/INFO]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
[18:16:30] [Render thread/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/armor_trims.png-atlas
[18:16:30] [Render thread/INFO]: Created: 128x64x4 minecraft:textures/atlas/decorated_pot.png-atlas
[18:16:30] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
[18:16:30] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
[18:16:30] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
[18:16:30] [Render thread/WARN]: Shader rendertype_entity_translucent_emissive could not find sampler named Sampler2 in the specified shader program.
[18:16:30] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas
[18:16:30] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
[18:16:30] [Render thread/INFO]: Created: 128x128x0 minecraft:textures/atlas/mob_effects.png-atlas
[18:16:30] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[18:16:45] [Worker-Main-7/ERROR]: Failed to retrieve profile key pair
java.io.IOException: Could not retrieve profile key pair
at fes.a(SourceFile:139) ~[1.20.1.jar:?]
at fes.b(SourceFile:79) ~[1.20.1.jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
[18:16:45] [Render thread/INFO]: Connecting to 127.0.0.1, 25565
[18:16:49] [Worker-Main-7/ERROR]: Failed to retrieve profile key pair
java.io.IOException: Could not retrieve profile key pair
at fes.a(SourceFile:139) ~[1.20.1.jar:?]
at fes.b(SourceFile:79) ~[1.20.1.jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
[18:16:49] [Render thread/INFO]: Connecting to 127.0.0.1, 25565
[18:16:53] [Render thread/INFO]: Connecting to 127.0.0.1, 25565
[18:16:53] [Worker-Main-7/ERROR]: Failed to retrieve profile key pair
java.io.IOException: Could not retrieve profile key pair
at fes.a(SourceFile:139) ~[1.20.1.jar:?]
at fes.b(SourceFile:79) ~[1.20.1.jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
^[[C^C%

支持&建议

用了一下,太喜欢这种操作console的风格了,就像用Windows Powershell一样,不过还是有几点建议:

  1. 在教程中教用户添加环境变量,直接在Powershell或者cmd里面直接使用,这样方便许多

  2. -h --help指令的反馈要精简,默认返回常用指令的帮助文档(可以增加--all参数返回全部指令的帮助文档)

  3. 控制台优化:

显示当前操作的游戏版本,参考Anaconda Prompt (anaconda3)的控制台,会显示当前操作环境的名称,下载和删改资源就默认选择这个游戏版本(可能实现难度较大)

  1. 导出整合包:

可以添加export指令:
比如:cmcl export

  1. 下载优化:
  1. 下载Minecraft版本时添加重命名版本的选项参数

  2. 增加对 resourcepack shaderpack datapack 和地图 的支持

  3. 给下载源默认值:
    比如就默认modrinth,或者把默认值添加到全局设置cmcl.json中,避免每次下载都要输入过多的参数

  4. 可以从其他网站的url直接下载资源:
    可以添加一个--from-url参数,比如我想直接从Github下载Sodium 0.4.9可以写--from-url=“https://github.com/CaffeineMC/sodium-fabric/releases/download/mc1.19.3-0.4.9/sodium-fabric-mc1.19.3-0.4.9+build.23.jar”

  5. 下载模组优化:
    自动检索依赖的模组项目,能够读取模组依赖的前置模组的mod id和版本要求,无论是否提供"--from-url"参数都从“--source”参数选择下载源(可能工程量比较大,可以缓一缓)

  6. 简化cmcl mod --install参数,并且可以指定模组版本,参考python的 pip工具,比如:cmcl mod --install [==](可能工程量较大,可以缓一缓)

  1. 资源管理优化:
  1. 管理模组(除了下载以外还可以删除模组,屏蔽模组(直接改扩展名就屏蔽了))

  2. 资源包/光影包/数据包/地图的管理指令

  1. 联机(这个最难搞,不着急)

最后提一点哈,不需要总把新的源码覆盖原本的master分支,不然旧版本的源码就看不到的,可以以版本命名分支并且把最新版分支设为主分支。
en~ 就这么多了,大佬可以参考一下,结合开发的难度和建议的合理性,期待你的更新

[建议]删除MCBBS源

目前MCBBS已关站,镜像下载源同时不可用,MCBBS源存留没有任何意义,申请删除

微软登录显示正版账号登录失败

登录正版账号失败: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

相对路径

暂不支持相对路径。日常使用的时候会有一点点麻烦(如图)
顺便问下Discussions去哪了
image

设置了版本隔离后无法启动包含forge的游戏

控制台输出

C:\Users\ARROWDANNAD>cmcl 1.19.2-养老
启动版本:1.19.2-养老 (1.19.2) | 登录账号:arrowdannad (微软账户) | Java 路径:D:\JAVA\java17\bin\java.exe
游戏跟随启动器退出:false | 全屏:false | 最大内存:4041MB | 窗口宽:854 | 窗口高:480 | 启动前检查账号:true
游戏目录:C:\Users\ARROWDANNAD.minecraft\versions\1.19.2-养老
资源目录:C:\Users\ARROWDANNAD.minecraft\assets
资源包目录:C:\Users\ARROWDANNAD.minecraft\resourcepacks

启动游戏中...
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-exports
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-opens
WARNING: Unknown module: cpw.mods.securejarhandler specified to --add-opens
Exception in thread "main" java.lang.ExceptionInInitializerError
at cpw.mods.niofs.union.UnionFileSystemProvider.newFileSystemInternal(UnionFileSystemProvider.java:115)
at cpw.mods.niofs.union.UnionFileSystemProvider.newFileSystem(UnionFileSystemProvider.java:105)
at cpw.mods.jarhandling.impl.Jar.(Jar.java:84)
at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:70)
at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:66)
at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:58)
at cpw.mods.jarhandling.SecureJar.from(SecureJar.java:50)
at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:84)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field static final java.lang.invoke.MethodHandles$Lookup java.lang.invoke.MethodHandles$Lookup.IMPL_LOOKUP accessible: module java.base does not "opens java.lang.invoke" to unnamed module @574caa3f
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at cpw.mods.niofs.union.UnionFileSystem.(UnionFileSystem.java:45)
... 8 more
游戏结束

C:\Users\ARROWDANNAD>

archlinux无法正常登陆microsoft帐号

系统:archlinux
图形化桌面:xorg-xinit i3(只装了这个桌面)
java:java17(pacman安装)
过程:
请在浏览器内登录您的微软账号,
如果登录成功,请返回到此处,等待完成登录。
登录需要一定的时间,请耐心等待。
Jun 14, 2022 11:45:51 PM fi.iki.elonen.NanoHTTPD$Response send
SEVERE: Could not send response to the client
java.net.SocketException: Broken pipe
at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:420)
at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826)
at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035)
at java.base/java.io.OutputStream.write(OutputStream.java:127)
at fi.iki.elonen.NanoHTTPD$Response$ChunkedOutputStream.write(NanoHTTPD.java:1442)
at fi.iki.elonen.NanoHTTPD$Response$ChunkedOutputStream.write(NanoHTTPD.java:1435)
at java.base/java.util.zip.GZIPOutputStream.writeHeader(GZIPOutputStream.java:185)
at java.base/java.util.zip.GZIPOutputStream.(GZIPOutputStream.java:97)
at java.base/java.util.zip.GZIPOutputStream.(GZIPOutputStream.java:112)
at fi.iki.elonen.NanoHTTPD$Response.sendBodyWithCorrectEncoding(NanoHTTPD.java:1663)
at fi.iki.elonen.NanoHTTPD$Response.sendBodyWithCorrectTransferAndEncoding(NanoHTTPD.java:1654)
at fi.iki.elonen.NanoHTTPD$Response.send(NanoHTTPD.java:1624)
at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:957)
at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
at java.base/java.lang.Thread.run(Thread.java:833)

java.io.FileNotFoundException: cmcl.json (Permission denied)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:235)
at java.base/java.io.FileWriter.(FileWriter.java:113)
at com.mrshiehx.cmcl.utils.Utils.saveConfig(Utils.java:333)
at com.mrshiehx.cmcl.modules.account.loginner.MicrosoftAccountLoginner.lambda$loginMicrosoftAccount$0(MicrosoftAccountLoginner.java:164)
at com.mrshiehx.cmcl.server.MicrosoftAuthenticationServer.lambda$serve$0(MicrosoftAuthenticationServer.java:48)
at java.base/java.lang.Thread.run(Thread.java:833)
登录账号成功
~/CMCL1.19  sudo -u funny java -jar CMCL.jar
未选择账号。请登录了您的账号之后,使用“-account -p”列出账号,记住您要选择的账号的序号,然后使用“-account <序号>”选择账号;或者在登录账号命令后面加上“-s”的参数。
~/CMCL1.19  sudo -u funny java -jar CMCL.jar -p
不正确的用法。
使用选项 -usage 或 -help 以获得使用手册。
~/CMCL1.19 
所以如何解决这个问题,我无法登陆

登录的名字

我使用 CMCL.exe -l -o PaltryLicense14 登录后再进入游戏,却发现名字变成了 XPlayer ,请大佬帮忙解决一下。

Since the snapshot 22w16b, it seems the launcher do not work properly and causing crashes.

Using the following commands to install the version 22w16b, and launch that version normally, you will get the crashes.

java -jar .\CMCL.jar -install 22w16b

...
Copy the native dependency libraries complete
Install the new version complete

java -jar .\CMCL.jar 22w16b

Starting game...
...
Game crash possible error: This error may occur because some of the native dependency library are missing or damaged, please re-download native dependency libraries via "-version -n " to fix this problem.

Following the tip:

java -jar .\CMCL.jar -version -n 22w16b

...
Copy the native dependency libraries complete
Download native dependency libraries complete

And relaunch the game:
java -jar .\CMCL.jar 22w16b

Starting game...
[19:04:00] [main/INFO]: Building optimized datafixer
[19:04:01] [Render thread/INFO]: [STDERR]: [LWJGL] Failed to load a library. Possible solutions:
a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
b) Add the JAR that contains the shared library to the classpath.
[19:04:01] [Render thread/INFO]: [STDERR]: [LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[19:04:01] [Render thread/INFO]: [STDERR]: [LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
Exception in thread "Render thread" [19:04:02] [Render thread/INFO]: [STDERR]: java.lang.NoClassDefFoundError: Could not initialize class com.mojang.blaze3d.systems.RenderSystem
[19:04:02] [Render thread/INFO]: [STDERR]: at ac.a(SourceFile:65)
[19:04:02] [Render thread/INFO]: [STDERR]: at ecu.a(SourceFile:2289)
[19:04:02] [Render thread/INFO]: [STDERR]: at ecu.a(SourceFile:2284)
[19:04:02] [Render thread/INFO]: [STDERR]: at net.minecraft.client.main.Main.main(SourceFile:207)
Game finished

The Error still remains.

After a simple check I found that in folder .minecraft\versions\22w16b\natives-windows
there are only 2 dlls in there.[SAPIWrapper_x64.dll, SAPIWrapper_x86.dll]

It seems like the launcher failed in copying the dependencies / libraries to the \natives-windows\ and causing the game unable to launch.

I manually copy the dlls in [previous_version_name]\natives-windows\ to 22w16b\natives-windows\ , and that dosen't work and got a super-long crash report from Minecraft and contains a lot of unrecognizable characters.

I think in this version of minecraft, mojang uses the newer version of these dependencies, and here is the download log from Mojang official launcher when you are trying to install the 22w16b:

Downloaded https://libraries.minecraft.net/com/mojang/datafixerupper/5.0.28/datafixerupper-5.0.28.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1-natives-windows.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1-natives-windows.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1-natives-windows.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1-natives-windows.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1-natives-windows.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1-natives-windows.jar to ...
Downloaded https://libraries.minecraft.net/org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1-natives-windows.jar to ...

So I manually download the objects that contain the "natives-windows" and unpack the jars, put the dlls into 22w16b\natives-windows\ , launch the game again using
java -jar .\CMCL.jar 22w16b
and it solved.

The library packs I used are in this zip, and their download URL are in the log from the mojang launcher.
native-windows.zip

I can't give a code-level solution or opinion because I don't know Java, but in my coding experience it's pretty easy to solve.

[建议] 增加对forge和fabric等加载器的更新的卸载功能

目前在cmcl使用只能第一次安装,之后想要卸载或者修改加载器的版本,只能重新安装。
并且如果直接把文件夹复制到其他启动器上会出现错误
在hmcl上会出现 没有安装加载器的时候无法安装加载器 的错误

[New Feature]不同游戏版本的不同JAVA问题

对于某些低版本(或者一些整合包)使用高版本的java可能会造成无法启动的问题。也就说对于一些游戏版本需要指定对应的Java版本。

小声BB:我自己都感觉自己事好多,这么多事怎么不自己去提交PR啊
作者辛苦了

快速进入游戏

1.20.1中未设置“快速进入游戏”选项,但在启动Minecraft后收到“无法快速加入游戏”提示
图片
Minecraft 1.20.1 安装Optifine(没装也是这样)
系统 Arch Linux,使用X11环境的KDE Plasma
qpLogFile qpSaveName项均为null
完整配置如图(账户信息打码)
图片

Launch Args relates to `Quick Play` always added when launching

Since Minecraft Snapshot 23w14a, there's a new feature called the Quick Play Mode, it simply allow the game to join a specific server/local world/realms instantly after the game has finished its launching and initialization progress, and this such feature is implemented by adding launching arguments, check this by Mojang for details.

But while using CMCL to launch a newer version of Minecraft, say 1.20, these arguments that relate to the Quick Launch was always added.

--quickPlayPath ${quickPlayPath} --quickPlaySingleplayer ${quickPlaySingleplayer} --quickPlayMultiplayer ${quickPlayMultiplayer} --quickPlayRealms ${quickPlayRealms}

Which causing the game to run into the Quick Launch mode with no target level given and showing up like this.

image

To solve this, just not adding these arguments as always, but additionally. Maybe even add related settings to the config file?

##update##

Located problem in src\main\java\com\mrshiehx\cmcl\modules\MinecraftLauncher.java, cauze you've done this minecraftArguments.addAll(argus); at ln278, the arguments relate to the quick play will just added into the minecraftArguments from the minecraftVersionJsonFile of the newer versions of the Minecraft. To fix, you can add a filter while reassembling the launch arguments at ln311, within the for iterator.

I mean, add a settings into the config(cmcl.json), and if the user actually set the quickplay to true and provided the target world/server for the quick play in the config file, then assemble all the arguments like the current code from ln311 ~ ln316, and then complete them using the code pattern like the current one for enabling the quick play, elseif the user provided the incomplete information for the quick play, or just set it to false, then just cut off those arguments in the for iterator at ln311 ~ ln316 by filtering out those argument.key by the keyword quickPlay, if found, abandon those keys and their value.

Here is the code simply modified by my self, it removes any arguments relate to quick play therefore fixed the issue in a hard-coded way.

(line 310 in src\main\java\com\mrshiehx\cmcl\modules\MinecraftLauncher.java)

   for (Argument argument : arguments1) {
       if(!((String)argument.key).contains("quickPlay")){
           minecraftArguments.add("--" + argument.key);
           if (argument instanceof ValueArgument) {
               minecraftArguments.add(((ValueArgument) argument).value);
           }
       }
   }

One step forward, we can add a variable to represent whether or not enabling the quick play, so we can change the behavior of the code, like this

   boolean enableQuickPlay = false;

   for (Argument argument : arguments1) {
       if(!((String)argument.key).contains("quickPlay") || enableQuickPlay){
           minecraftArguments.add("--" + argument.key);
           if (argument instanceof ValueArgument) {
               minecraftArguments.add(((ValueArgument) argument).value);
           }
       }
   }

and then if it got enabled, fill up those values (don't forget to dock these values to the config and read them from it)

       ...
       if (s.contains(source = "${quickPlayPath}")) {
          minecraftArguments.set(i, s = s.replace(source, String.valueOf(quickPlayPath)));
       }
       ...

and that's it.

建议增加参数

建议安装forge的指令可以有一个参数指定forge版本从而跳过手动选择,方便实现全自动

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.