Optimization and multithreading written by n1luik
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.
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]
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.
moonrise_fast_palette uses code from moonrise-DKAF-NbtIoMixin_NotGZip=true) Using try catch solves gzip problem of NBT IO, but should use commons-compress.-DKMT-threadMax=[count] to set max threads.D-KMT-callMax=[count] to set multi-thread tasks assigned maximum number of threads to use by default.-DKMT-ThreadpoolKeepAliveTime=[millisecond]: The time to stop useless thread.-DKAF-ClientboundKeepAlivePacket_Max=[millisecond] to modify time request of ClientboundKeepAlivePacket, default 15 seconds.ClientboundKeepAlivePacket needed to send every 30 seconds, or kicked due to connection timeout.-DKAF-ServerTimeout=[seconds] to set server connection timeout limit time (possible invalidate)-Dforge.readTimeout=[seconds]0DKMT-ChunkGeneratorMode2Start=[true, false] controls whether run command: /SetterWorldConfig world setM2 %%KMT-ChunkGeneratorMode2Start%% automatically when started.-DKAF-RemoveMixin:[class name] to disable specific mixin, also k_multi_threading does.-DKAF-RenderOptimizer=true: Rendering optimization.-DKMT-SafeUnloadChunk=true: Run chunk unload function in chunk generate thread-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 Connector fabric-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 disable ClientboundKeepAlivePacket-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.-DKAF-RemoveFlyingTest=true: Remove flying test.-DKMT-LoginMultiThreading=true: log in muti-thread.[net.minecraftforge.event.OnDatapackSyncEvent]-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.DKMT-LoginMultiThreading.TaskSizeMax=[count]: Set max login tasks running at the same time, default 8.-DKAF-FixAllPacket=true: Fix data pack (Network), work when both server and client turning on.-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: Safer ClientboundBlockEntityDataPacket compress, but influence performance.-DKAF-packetOptimize.CompatibilityMode.ClientboundSectionBlocksUpdatePacket=true: Safer ClientboundSectionBlocksUpdatePacket and ClientboundBlockUpdatePacket compress, but also influence performance.-DKAF-UnsafeCinderscapesFix1=true: Limit Cinderscapes enableAshFall 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./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.ClearErrorSize to clear the number of server crashes caused by error report.RemoveRemoveErrorSize let server never record crashes times.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.-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.world.tick_scheduler function of Canary will cover this mod's muti-thread fix: ClassInstanceMultiMap, so must turn off that ( auto turn off using -DKAF-FixConfigAuto=true, needing restart server)/config/canary.properties and write mixin.world.tick_scheduler=false(-DKAF-FixConfigAuto=true can do this automatically)entity_by_type function of Canary will also cover this mod's muti-thread fix: ClassInstanceMultiMap, so must turn off that ( auto turn off using -DKAF-FixConfigAuto=true, needing restart server)/config/canary.properties and write mixin.collections.entity_by_type=false(-DKAF-FixConfigAuto=true can do this automatically)world.tick_scheduler of Lithium will cover this mod's muti-thread fix: ClassInstanceMultiMap, so must turn off that ( auto turn off using -DKAF-FixConfigAuto=true, needing restart server)/config/lithium.properties and write mixin.world.tick_scheduler=false(-DKAF-FixConfigAuto=true can do this automatically)entity_by_type function of Lithium will also cover this mod's muti-thread fix: ClassInstanceMultiMap, so must turn off that ( auto turn off using -DKAF-FixConfigAuto=true, needing restart server)/config/lithium.properties and write mixin.collections.entity_by_type=false(-DKAF-FixConfigAuto=true can do this automatically)logOffthreadEntityAdd of Cupboard may not be compatible, using -DKAF-FixConfigAuto=true automatically disable.mixin.perf.cache_upgraded_structures of ModernFix, recommend determine disable or not after testing in game.mixin.perf.cache_upgraded_structures=false to config/modernfix-mixins.propertiesServerboundMovePlayerPacket beforehand and report an error.Modifier is already applied on this attribute!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).enableAshFall causes too much performance consumption (after last triggered, the next triggered chunk if couldn't find target, it will try 128 times searching chunks), author could not optimize safely, could just limit it to the nether.Code is committed to Gitee directly. Github will update each day automatically (UTC 00:00)
Multi-thread could only used on server, working on client may cannot log in.
JVM parameter of -DKMT_Client=true could only used above 1.0.4.0