Compatibility
Minecraft: Java Edition
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Creators
Details
Summary
This project contains 2 mods: k_all_fix, K_multi_threading.
In these mods, K_multi_threading support 1.17+ muti-threaded work in theory, but author unsure it compatibles with other mods, currently just have 1.20.1 tested.
For now, muti-thread couldn't work in Client.
Use muti-thread function by default, you can use -DKMT_D=[any character]
to disable. Also, you can use -DKAllFix_D=[any character]
to disable this mod.
How to use
Before 1.0.3.18
The file you download could not use directly, you should use following command to generate at the specific place
java -jar k_multi_threading-xxx.jar -i [empty or download directory]
After 1.0.3.18
You could run directly, but reserse install command.
Following tips or read source code(n1luik.K_multi_threading.core.util.Util
), installing processing just generate k_multi_threading-base.jar
,k_multi_threading-asm.jar
and won't do anything else.
For some function, it needs to download some repositories, and you could also put these files to [game directory]/lib
manually if it downloads failed.
Repositories for some function
Functions
- Fix Biolith compatibility issue (including MCreator those whom regenerate MultiNoiseBiomeSource, or others like Terramity).
- Fix problems of Petrolpark's Library 1.4.2 couldn't run server on some version of Java
- could use -DKAF-DisablePetrolpark=false to close
- Allow close muti-thread independently.
- Fix magnetic field optimization problem with Alex's Caves.
- Fix mixin performance issue with Create: Diesel Generators.
- Fix old version of Destroy bug: database connecting failed and causes crash.
- (Unsafe, need open
-DKAF-NbtIoMixin_NotGZip=true
) Usingtry catch
solves gzip problem ofNBT IO
, but should usecommons-compress
. - Use
-DKMT-threadMax=[count]
to set max threads. - Use
-KMT-callMax=[count]
to set multi-thread tasks assigned maximum number of threads to use by default. -KMT-ThreadpoolKeepAliveTime=[millisecond]
: The time to stop useless thread.- Use
-DKAF-ClientboundKeepAlivePacket_Max=[millisecond]
to modify time request ofClientboundKeepAlivePacket
, default 15 seconds.ClientboundKeepAlivePacket
needed to send every 30 seconds, or kicked due to connection timeout.
- Use
-DKAF-ServerTimeout=[seconds]
to set server connection timeout limit time (possible invalidate)- Another settings offered by Forge are also recommended to set:
-Dforge.readTimeout=[seconds]
- Another settings offered by Forge are also recommended to set:
DKMT-ChunkGeneratorMode2Start=[true, false]
controls whether run command:/SetterWorldConfig world setM2 %%KMT-ChunkGeneratorMode2Start%%
automatically when started.- Use
-DKAF-RemoveMixin:[class name]
to disable specific mixin, alsok_multi_threading
does.
Optional
-DFixBiolithBugMode2=true
: Turning on this will try to solve most Biolith compatibility problem, but with the risk encountering influential bug.-DKAF-gtceu.MedicalConditionTrackerMixin=true
: Prohibit radiation of GTM-DKAF-Fix_fabric-object-builder-api.jar=true
: Fix bug about Sinytra Connectorfabric-object-builder-api
not compatible to 47.3.47-DIndependencePlayer=true
: Turning on player asynchrony, but high probability useless for optimizing performance.-DKAF-RemoveClientboundKeepAlivePacket=true
: To disableClientboundKeepAlivePacket
-DKAF-FixTFMGDestory=true
: Make Destroy compatible with Create: The Factory Must Grow. If just install Destroy, Creative Pump couldn't connect to Create's pipe.-DKAF-FixConfigAuto=true
: Auto modify config file to proper properties.-DKMT-LoginMultiThreading=true
: log in muti-thread.- Prohibit too many mods cause bug in
[net.minecraftforge.event.OnDatapackSyncEvent]
- Muti-thread login just compatible to Original Minecraft for this time. For other mod, generally have no so much data needed compressing (I haven't met so far).
-DKMT-LoginMultiThreading.ConnectionLock=true
: Wait for asynchronous execution to complete at the end of tick. Turning off this will slightly enhance performance, but will slow down login speed.- Turning off will cause crash. Default off, need turn on manually.
DKMT-LoginMultiThreading.TaskSizeMax=[count]
: Set max login tasks running at the same time, default 8.
- Prohibit too many mods cause bug in
-DKAF-FixAllPacket=true
: Fix data pack (Network), work when both server and client turning on.- Current fixed mod:
-DKAF-packetOptimize=true
: Optimize some data pack, requiring open on server and client:-DKAF-packetOptimize.AttributesReOutputTime=[millisecond]
: Set the internal of force resent, default 2 minutes.-DKAF-packetOptimize.CompatibilityMode.ClientboundBlockEntityDataPacket=true
: SaferClientboundBlockEntityDataPacket
compress, but influence performance.-DKAF-packetOptimize.CompatibilityMode.ClientboundSectionBlocksUpdatePacket=true
: SaferClientboundSectionBlocksUpdatePacket
andClientboundBlockUpdatePacket
compress, but also influence performance.
-DKAF-UnsafeCinderscapesFix1=true
: Limit CinderscapesenableAshFall
performance consumption function only in the nether.-DKAF-fix.asynchronous.ClientboundCustomQueryPacket=true
: Handshake asynchronous, if you load many mods, you may encounter problem that packet stuck and can't play servers during the handshake. In that case, you could turn on this to solve the problem.
Commands
/debug_GetterClassFile [class name]
: Get game final running data, saved under game directory ([Save time timestamp]_save.class)./SetterWorldConfig [world, ClearErrorSize, RemoveRemoveErrorSize]
: Won't save after setting SetterWorldConfig.- Use
ClearErrorSize
to clear the number of server crashes caused by error report. - Use
RemoveRemoveErrorSize
let server never record crashes times. - world [registered dimension id]:
setM2 [true,false]
: Set another way to realize dimension, but have risk to be stuck.setMultiThreading [count]
: Default 0, set muti-thread tasks number, but have risk to be stuck.
- Use
Problem
- Muti-thread thead pool may intercept error and not crash, but if intercepts times over block count limit, it will report an error.
- If not set
-DKMT-threadMax=[CPU threads]
may cause terrain generation get inexplicably stuck. If you do encounter this after you set this value, just set another higher count. logOffthreadEntityAdd
of Cupboard may not be compatible, using-DKAF-FixConfigAuto=true
automatically disable.- May be conflict with
mixin.perf.cache_upgraded_structures
of ModernFix, recommend determine disable or not after testing in game.- How to disable: add a new line
mixin.perf.cache_upgraded_structures=false
toconfig/modernfix-mixins.properties
- How to disable: add a new line
- Login muti-thread may cause server receive
ServerboundMovePlayerPacket
beforehand and report an error. - ParCool!require die in server for once to use muti-threading login .
- Grimoire of Gaia have a little chance to report
Modifier is already applied on this attribute!
- NuclearCraft: Neoteric fission reactor restart has small chance to cause a cooling calculation error.
- Over 1.0.3.3,
n1luik.K_multi_threading.core.base.ParaServerChunkProvider
,n1luik.KAllFix.util.TaskRun
and some code to regenerate chunk must use c2 for muti-threading, or else it will have a bad performance (java will run c2 automatically, but need to wait for a while). - From 1.0.3.12, in my Windows Server 2022 Datacenter 21H2 20348.3091|pve8.2.2 revised version kvm e5-2690v4*2 virtual host cpu, little chance to encounter system-generated thread scheduling bug and causes system management thread exception. In this situation, the CPU power consumption is 900% of normal.
- Solution: restart the server.
- 1.20.1 Cinderscapes
enableAshFall
causes too much performance consumption (at any time, for every chunk to get 128 times chunk data), author could not optimize safely, could just limit it to the nether.
Status
Code is committed to Gitee directly. Github will update each day automatically (UTC 00:00)