MCMT - 多线程模组
如果在使用此模组时遇到其他模组的 Bug,请尝试在卸载此模组的情况下复现问题,因为其他模组开发者不应被迫去处理并发调试的复杂性。
本模组由 MC Server Hosting 赞助支持
获取我们最受欢迎的搭载 Ryzen 3000 和 5000 系列处理器、配备 8GB 内存的 Minecraft 服务器托管套餐,每月仅需 15 美元!更多详情请访问
这是一个对 Minecraft 的 tick 执行进行多线程处理的模组。听起来很疯狂,对吧?它由核心模组(coremod)的黑魔法驱动,其效果仅在我测试过的范围内有效。
本模组改变了服务器端处理逻辑(无论是专用服务器还是单人游戏的集成服务器),并将所有世界、实体、方块实体和环境刻分发到线程池中,从而实现 Minecraft 的并行执行。测试表明,在单人游戏中,启用与禁用相比,刻时间改善了约 20%+。注意,卸载与禁用的表现看似相似,但由于该模组对游戏的许多执行流程进行了调整,其时间特征会有所不同。在单人游戏中,我观察到平均改善幅度接近 50%,而在多人游戏中,提升幅度可能更高。
理论上,如果该模组开发得足够完善(即达到稳定状态),它应该能够允许单个服务器实例中容纳更多玩家;或者在模组化游戏中加载和处理更多的区块。
注意:本模组仅对刻执行进行多线程处理;它可能不会帮助提升帧率或类似方面的性能。
我创建了一个 Discord 频道,如果你想交流/聊天/投诉问题:
安装
从 0.18.60 版本开始,你只需下载 jar 文件,它会自动解压,无需额外操作。
请注意,如果你遇到重大问题,请尝试使用 Java 8。目前似乎存在一些 JVM 版本兼容性 bug,我正在调查中。此问题已在更新 0.21.80 中修复。
需要注意的是,在卸载模组时会有两个 jar 文件需要删除。
之前的同步流程(0.17.x):
随着最新版本发布,安装过程现已更改
现在需要两个 jar 文件:一个用于模组的核心功能,另一个用于注入 ModLauncher 以允许修改 FastUtil。即使没有第二个 jar,游戏也能加载,但稳定性会更差。我正在研究解决方案,让用户无需下载两个 jar,但这仍在进行中。
这两个 jar 分别是:
- jmt_mcmt-{version}-{mcversion}
- jmt_mcmt-{version}-syncfu
由于 CurseForge 的特殊机制,我只能将其中一个附件关联到某个版本(因为否则会被视为重复文件;至于为什么他们不能自动去重,我也不清楚)。
我正在尝试修复这个问题,但出现这种情况的唯一原因是,我原本以为将其作为单个 jar 方案运行正常,而且我确实记得测试过某种配置,所以我不确定到底发生了什么。
功能特性
- 多线程处理以下计时器:
- 方块实体(即方块)
- 实体(生物等)
- 世界/维度(因此主世界和末地可以并行处理)
- 环境计时器(植物生长、草方蔓延等)
- 与原版 Minecraft 完全兼容(截至目前的测试结果)
- 理论上兼容大多数模组
- 正在测试中;截至目前效果良好
警告及其他说明
如果您在托管启动器中使用此模组并希望移除它,请确保删除 BOTH jars(两个 jar 文件)。该模组采用“Jar in Jar”方案将核心模组和 Forge 模组打包在一起,但某些启动器似乎只会移除其中一个 jar。
此模组以一种从未被设计的方式操作 Minecraft 的内部机制。尽管截至目前已进行了超过 10 小时的测试,但在整体范围内这并不算多。请备份存档;预期会出现 Bug;等等。
顺便一提,如果您在使用模组游玩;除非模组作者明确表示接受反馈,否则请勿向模组作者报告 Bug,因为模组(目前)并非为支持多线程而构建。致各位模组作者:此模组会定期在日志中记录 “MCMT enabled; logs invalid”,以便非常明确地提示您应忽略这些日志。
另外请注意:截至目前,我遇到过 1 次世界损坏的情况;但那可能是由设置中的其他模组引起的(且发生在 1.16.1 版本中,因此也可能是由 Forge Beta 引起的)。无论如何,从 0.12.22 版本开始,包含了一个强制加载选项,可强行加载损坏的区块。因此,建议您测试您的模组组合;如有任何 Bug,请通过 GitHub(Issues 链接)报告,并添加存档备份工具。
已废弃的版本:
以下是我发布时存在问题的版本;如果你恰好有其中一个,请不要使用。它们已从下载列表中移除。这也算是对所犯错误的一个记录。这些内容此前以醒目的字体显示在页面顶部,但现在看来已不再需要
重要通知:请注意,0.13.x 构建版本中,所有早于 0.13.27 的版本均存在故障,并且曾被短暂开放下载;这些损坏的版本会导致崩溃,因此应能明显看出问题。此次故障是由于我在尝试打包发布时操作失误所致,我将重新调整我的构建流程(目前的流程涉及复制文件 6 次以创建各种构建版本)。此后我已基本修复了构建流程(现在我只需更改少数几个文件即可构建所有必要的版本)
警告:我又得发一条“版本又坏了”的消息(这很糟糕);版本 0.17.52 实际上无法正常工作,因此几乎毫无用处,但至少不应导致崩溃。检查模组是否正常加载的简单方法是查看日志中是否显示 "[ne.mi.co.Co.jmt_mcmt/COREMODLOG]: [JMTSUPERTRANS]"。如果没有出现该日志,则说明模组未加载,很可能是由于版本损坏。对于由此带来的不便,深表歉意。
命令
所有命令均以 "/mcmt" 为前缀;自动补全功能可以为您列出所有命令,但如果您想自行查阅,以下提供了命令列表。
配置
这些命令允许您实时修改 MCMT 的配置,包括完全禁用执行路径更改、保存配置以及还原配置。
Toggle [option](切换 [选项])
此命令用于切换任何代码路径更改。如果不带参数使用,将发出全局禁用指令。
Save | Reload(保存 | 重载)
这两个命令分别用于将当前运行的配置保存到文件系统,或从文件系统重载当前运行的配置。
TEManage(方块实体管理)
从此处开始的子命令允许您管理方块实体的执行;list 命令将列出被加入黑名单/白名单的方块实体;target 命令允许您确定并对准的方块执行操作(例如将其加入白名单/黑名单)。
Status(状态)
此命令提供主配置的当前状态信息(即哪些执行路径更改已启用,哪些已禁用)。
统计
Stats 命令将提供有关当前 MCMT 状态的信息;可以使用 toggle 命令切换其显示,也可以将其用于以 CSV 格式将统计数据记录到磁盘。
调试
这些是内部调试命令;您可以随意使用它们;但请注意,它们可能会导致某些功能异常。
运行原理
Minecraft 默认的 Tick 循环基本上就是一堆嵌套的 for-each 循环(这里为了简化起见作此描述)。这意味着当原本应在循环内执行逻辑时,它会将执行任务推送至线程池,由线程池处理工作。
为了实现这一点,它修改了多个 Minecraft 内部结构,使其成为可能(例如允许非主线程加载区块等)。
稍后将在 GitHub 上提供进一步的解释。
聚光灯/演示视频
已知模组不兼容项
此处列出以某种方式不兼容的其他模组。
兼容性推荐的配置设置:
- disableWorldPostTick = true
- enableChunkTimeout = true
- enableBlankReturn = true
全局不兼容
- Performant - 该模组的较新版本似乎会导致难以排查的故障;兼容性适配正在开发中。
报错但可忽略
- Rough Mobs Reloaded - 在 RiderLocation 期间会在寻路代码中引发 NPE(空指针异常);此错误可忽略,或在 RMR 的配置中禁用相关功能。
需要更改配置
- Clumps - 在 MCMT 配置中将选项 `disableWorldPostTick = true` 设为开启。
- LycanitesMobs - 在其配置中禁用地牢生成(Bug 原因未知)- (待验证 v0.20.x 版本是否仍需要此操作)
此前曾存在故障
- Lava monsters - 已在构建版本 0.11.19 中修复。
- Serene Seasons - 已在 0.11.19 中修复。
想要支持我吗? 我有 Ko-Fi 页面
MCMT - Multithreading Mod
If you encounter bugs in mods while using this mod, please try to reproduce them without this mod installed as other mod devs shouldn't have to wrap their head around debugging concurrency.
This mod is sponsored by MC Server Hosting
Get our most popular Ryzen 3000 and 5000 powered Minecraft Hosting plan packed with 8GB of RAM for only $15 a month! Find out more at
This is a mod, that multithreads minecraft's tick execution. Crazy, I know. It's brought to you by the dark forces of coremodding, and works only as well as I've tested it
This mod alters the serverside processing (be it on a dedicated server or the single player integrated one) and dispaches all worlds, entities, tile entites and environment ticks to a thread pool, allowing for the parallel execution of minecraft. Under testing this shows about a 20+% improvement in tick times Enabled vs Disabled in single player. Note that uninstalled vs disabled appears to be similar but will have different time charicteristics as this does muck around with lots of the game's execution. In single player I've seen this be closer to 50% on average, and in multiplayer it can possibly be even higher.
Theoretically if this is developed enough (i.e. to the point of stability), it should allow more players in a single instance of a server; or more chunks to be loaded and processed in a modded game.
Note: This mod only mulithreads tick execution; it will probably not help with framerate or anything like that.
I've made a discord, if you want to talk/chat/complain about issues:
Installing
As of 0.18.60 you just download the jar and it self unpacks, no additional effort required
Please also note that if you are having major issues, please try Java 8. There appears to be some odd jvm-version compatibility bug, which I'm looking into. This was fixed in update 0.21.80
Be aware that when uninstalling the mod there will be two jars to delete though
Previous syncfu proccess (0.17.x):
With the latest release, the process for installing has now changed
There are now 2 jars required, one for the actual mod functionality, and another for hooking into modlauncher to allow for the modification of FastUtil. The game will load without the second jar, but will be more unstable. I'm looking into finding a solution for people to not have to download both jars, but that's still work in progress
The two jars are:
- jmt_mcmt-{version}-{mcversion}
- jmt_mcmt-{version}-syncfu
Because curseforge be wierd, I can only attach it to one of the releases (because otherwise it's a duplicate file; why they can't just dedupe IDK)
I'm looking into fixing this but the only reason this is happening at all is because I thought this worked correctly as a single jar solution, and I definately remember testing some configuarion of this, so IDK what happened
Features
- Multithreads ticks of:
- Tile Entities (i.e. blocks
- Entities (Mobs, etc.)
- Worlds/Dimensions (So the overworld and nether can be processed in parallel)
- Environmental ticks (Plant growth, grass spread, etc.)
- Full compatibility (as far as has thus far been tested) with Vanilla minecraft
- Theoretically Compatible with most mods
- This is being tested; but thusfar has worked
Warnings and stuff
If you use this mod with a managed launcher, and wish to remove it; ensure you delete BOTH jars. The mods shops as a Jar in Jar solution to package both the coremod and the forge mod together, but some launchers appear to only remove one of the jars.
This mod is mucking around with minecraft internals in ways they were never indended to be. While it has thus far had >10 hours of testing on it; that's not really that much in the grand scheme of things. Make world backups; expect bugs; etc.
On that note, if you are playing with mods; DO NOT report bugs to the mod author unless they explicitly state they accept them; as mods are not built (currently) to support multithreading. To any mod authors out there, this logs "MCMT enabled; logs invalid" in the logs at a regular interval so as to make it extremely clear that you should ignore these logs.
Also note: Thus far I have encountered 1 occurance of world corruption; but that may to have been caused by another mod in the setup (and was in 1.16.1 so may have been caused by forge beta). Anywho, as of 0.12.22 there is included force-load option that will forciably load damaged chunks. As such, I advise you test setups; please report any bugs to the github (via the issues link) and add a world backup utility.
Broken versions:
Below are versions which I released broken; on the off chance you have one of these, you need to not use it. They have been removed from download though. It's also a good record of mistakes made. They were at the top of the page in angry lettering, but they are now deemed to be no-longer required
Important notice: Please also note that all versions of the 0.13.x build BEFORE 0.13.27 are broken, and were visible for download for a few hours; their broken ness will result in crashes, so should be obviously broken. The breakage was due to me messing up when I was trying to package for release, and I'll rework my build process (as it currently constitues copying files 6 times to create the various builds). I've since fixed the build process mostly (I can now build all necesary version by only changing a couple of files)
WARNING: I get to post another "version be broke" message (which is bad); version 0.17.52 doesn't actually work so is kinda a bit useless, but shouldn't break at least. The easy way to check if the mod is loading properly is if you are seeing "[ne.mi.co.Co.jmt_mcmt/COREMODLOG]: [JMTSUPERTRANS]" in your log. If that's not there, then the mod isn't loading, probs because it's a broken version. Sorry for the inconvenience.
Commands
All commands are subtree'd on "/mcmt"; Autocomplete can find you all the commands but the listings are below should you want to look at them
Config
These allow you to modify the config of MCMT in real time, including totally disabling execution path changes, saving the config, and reverting it
Toggle [option]
This let toggle any of the code path changes. Without any arguments it will issue a global disable
Save | Reload
These either save the running config to the file system, or reload the running config from the file system
TEManage
Subcommands from here let you manage tile entity execution; list will list black/whitelisted TE's; target will let you determine/do stuff with the block you are looking at (like adding it to the white/black list)
Status
This command gives you the current status of the main config (i.e. which execution paths changes are enabled vs disabled)
Stats
Stats will give information about the current MCMT status; it can be toggled using toggle, and can also used for logging stats to disk in a CSV format.
Debug
These are internal debug commands; play with them as you wish; but be aware they may break stuff.
Operating principal
The default minecraft tick loop is basicly just a bunch of for-each loops inside eachother (Basicly here being for simplicity). What this does is say that whenever it would normally do the execution inside the loop, it pushes the task of performing the execution to a thread pool, which will execute handle the work.
In order to do this, it modifies several internal minecraft constructs to make this viable (such as allowing non-main threads to load chunks, etc.).
An additional explanation will be avaliable on github at some point
Spotlight/Demo Videos
Known mod incompatibilities
Here I'll put any mods that are incompatible in some way or another
Recomendations config settings for compatibility:
- disableWorldPostTick = true
- enableChunkTimeout = true
- enableBlankReturn = true
Globally incompatible
- Performant - Later versions of this seem to cause breakages that are unhelpful; Compat is being worked on
Errors but ignorable
- Rough Mobs Reloaded - Causes an NPE in the pathfinding code during RiderLocation; is ignorable or this can be disabled in RMR's config
Requires configuration changes
- Clumps - Toggle the option `disableWorldPostTick = true` in the MCMT config
- LycanitesMobs - Disable dungeon generation in it's config (bug cause is unknown) - (TODO verify if this is still needed as of v0.20.x)
Previously broken
- Lava monsters - Was fixed by build 0.11.19
- Serene Seasons - Fixed by 0.11.19
Want to support me? I have a Ko-Fi
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCMT
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
测试移植到 1.18.2?
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧