Skip to content

1.16 Summary of Patches

embeddedt edited this page Jun 1, 2024 · 10 revisions

mixin.bugfix.chunk_deadlock

Attempts to prevent chunk system deadlocks or provide additional debug information in the log when they occur. These deadlocks usually manifest as the server freezing indefinitely (e.g. entities not moving), while the client continues to work just fine.

mixin.bugfix.chunk_deadlock.valhesia

Patches Valhesia Structures to fix an issue in its code that causes frequent worldgen/chunkloading deadlocks.

mixin.bugfix.cofh_core_crash

Fixes a multithreading issue in CoFH Core that can cause rare crashes during launch.

mixin.bugfix.concurrency

The patches in this group fix concurrency-related issues within Minecraft and/or Forge. Most of them result in rare, hard-to-diagnose crashes during loading.

mixin.bugfix.ctm_resourceutil_cme

Fixes a multithreading issue in ConnectedTexturesMod that can cause rare crashes during launch.

mixin.bugfix.ender_dragon_leak

Fixes a memory leak in vanilla caused by the ender dragon retaining a reference to the previous client world.

mixin.bugfix.entity_load_deadlock

Fixes many issues where EntityJoinWorldEvent/EntityJoinLevelEvent cause a worldgen deadlock, by slightly deferring entity loading. Should not, however, cause any noticeable behavior changes in-game.

mixin.bugfix.entity_pose_stack

Fixes Forge issue #9118, where mods can cause undebuggable render crashes by pushing the matrix stack without popping it.

mixin.bugfix.file_dialog_title

Fixes a security issue with the worldgen settings file dialog

mixin.bugfix.fix_config_crashes

Fixes Forge configs occasionally becoming corrupted when launching the game.

mixin.bugfix.forge_vehicle_packets

Fixes a bug introduced by a Forge patch that causes excessive amounts of chunk data packets to be sent to the player if they are riding a vehicle on a chunk border.

mixin.bugfix.item_cache_flag

Fixes MC-258939

mixin.bugfix.mantle_model_cme

Fixes a bug in Mantle that can cause random ConcurrentModificationException crashes when rendering Tinkers Construct content.

mixin.bugfix.mc218112

This option fixes a deadlock that can occur if an exception is thrown while processing entity data. Vanilla does not correctly unlock the data manager when it should. This is tracked as MC-218112 on the bug tracker, and was fixed by Mojang in 1.17.

mixin.bugfix.model_data_manager_cme

Works around design flaws in the Forge ModelDataManager system that can cause unexpected concurrency issues.

mixin.bugfix.packet_leak

Experimental, not enabled by default. An attempted fix for the memory leak issue that occurs after playing long enough on 1.16.

mixin.bugfix.paper_chunk_patches

1.18 and newer. A key optimization. Ports a patch from Paper that fixes issues on 1.17 with chunkloading requiring huge amounts of memory and generating many CompletableFuture instances. 1.18+ are now able to load worlds on only 400MB of memory like 1.16 could.

mixin.bugfix.preserve_early_window_pos

Makes the game window retain its existing size when control is handed over from Forge's early loading to Minecraft code. Fixes the window teleporting back to the center of the screen after being dragged, etc.

mixin.bugfix.recipe_book_type_desync

Fixes Forge clients being disconnected when connecting to a vanilla server if mods add custom recipe book entry types.

mixin.bugfix.refinedstorage.te_bug

Fixes Refined Storage external storage blocks occasionally failing to show contents of drawers, etc. when loaded. Backport of Refined Storage PR #3435, which was only applied to 1.18 and later.

mixin.bugfix.remove_block_chunkloading

Fixes zombie pigmen keeping the 0, 0 chunk loaded perpetually on Forge. Backport of Forge PR #8583.

mixin.bugfix.restore_old_dragon_movement

Fixes MC-272431, which tracks the ender dragon being unable to dive to the portal as it did in 1.13 and older. This causes the dragon to fly quite a bit differently from what modern players are used to and also patches out one-cycling, so it's not enabled by default. Thanks to Jukitsu for identifying the regression in the vanilla code.

mixin.bugfix.starlight_emptiness

Fixes an occasional Starlight crash due to emptiness maps not being initialized. Backport of the same fix in Starlight for 1.18.x.

mixin.bugfix.tf_cme_on_load

Patches Twilight Forest to perform non-thread-safe client setup using the main thread as it should, rather than the FML worker thread.

mixin.bugfix.unsafe_modded_shape_caches

Fixes various ConcurrentModificationExceptions that can occur in content mods when computing block shapes

mixin.bugfix.world_leaks

Reduces the memory usage of old client-side worlds that aren't needed after switching dimensions. These are normally garbage collected in vanilla, but mods sometimes retain references to them.

mixin.core

Core patches required for ModernFix to work

mixin.devenv

Patches used when running in a development environment, for speed improvement and/or testing

mixin.feature.branding

Adds ModernFix to the branding list on the title screen, and also to the F3 screen.

mixin.feature.direct_stack_trace

Normally off, can be enabled to force the raw stack trace to be dumped to the log when a crash occurs. Occasionally vanilla's crash report system fails to work properly and gives an entirely irrelevant stack trace/report.

mixin.feature.integrated_server_watchdog

Adds the vanilla watchdog to singleplayer worlds as well, but just prints out the stacktraces rather than forcefully terminating the world. This version includes the functionality of Fullstack Watchdog, but the latter is still needed for multiplayer.

mixin.feature.measure_time

Uses a couple injections to measure world load time, datapack reload time, resource reload time, bootstrap time, and adds the necessary hooks to enable vanilla's unused profiler logic for resource reloading if so configured.

mixin.feature.snapshot_easter_egg

Adds easter egg features (does not affect any vanilla visuals or behavior) when running on a snapshot version.

mixin.feature.spam_thread_dump

To be used for debugging purposes only. Causes a thread dump to be output to the log every 60 seconds. This can help to diagnose unexplained freezes during loading/gameplay.

mixin.feature.spark_profile_launch

If enabled, and a compatible version of Spark is installed, the entire launch sequence will be profiled until the main menu.

mixin.feature.stalled_chunk_load_detection

This option may help to detect the cause of chunkloading freezes. However, leaving it enabled may cause slightly worse performance.

mixin.feature.warn_missing_perf_mods

Shows a warning on startup if other performance mods considered essential and highly compatible are not present

mixin.perf.async_jei

1.16 only. A key optimization. Patches JEI to perform its reloading on a background thread, completely eliminating the long delay it adds to world loading.

mixin.perf.async_locator

1.16 only. Backports the Async Locator mod's patches to eliminate server freezes associated with /locate, loot table generation, etc.

mixin.perf.biome_zoomer

1.16 only. Minor optimization to improve the performance of the biome zoomer using logic from 1.18.

mixin.perf.blast_search_trees

All versions. If REI or JEI are installed, construction of the vanilla search trees for creative searching is disabled, and searching is instead done using these mods' search implementations. This saves several seconds during world loading, and probably also saves some RAM as well (although I have not measured).

mixin.perf.boost_worker_count

1.16 only. Removes the hardcoded cap on worker thread count, similarly to what Mojang did in 1.18.

mixin.perf.cache_blockstate_cache_arrays

All versions. Avoids creating fresh copies of enum arrays each time a blockstate cache is initialized. Minor optimization, but easy to do.

mixin.perf.cache_model_materials

All versions. Memoizes the RenderMaterial (texture) collection and dependency list that models return instead of requiring them to be recalculated on each request. Helps accelerate the model load/bake process.

mixin.perf.cache_strongholds

All versions. Saves the generated list of stronghold positions with the world, instead of regenerating it on every world load. Saves a little bit of time on 1.16, and quite a bit more on 1.18 and 1.19.

mixin.perf.cache_upgraded_structures

All versions. Many mods ship outdated structure files, which requires the game to upgrade them using DFU every single time they are loaded. This can be quite slow. This patch adds logic to instead save the upgraded version of the structure, and reuse it on the next load. To handle the case that the mod changes a structure file but not the name, the original file's hash is compared against the cached version, and if they do not match the structure will be upgraded again.

mixin.perf.clear_fabric_mapping_tables

Reduces memory usage by clearing mapping data structures in Fabric Loader that are either redundant or rarely used by mods. Off by default for compatibility reasons.

mixin.perf.clear_mixin_classinfo

Force-loads all mixins when launch finishes and then clears out mixin data structures to remove most of Mixin's memory footprint. Disabled by default for compatibility reasons.

mixin.perf.compact_mojang_registries

(Fabric) Experimental option that reduces the memory usage of registries by roughly 50%. Not useful in most modpacks unless they contain millions of blocks and items.

mixin.perf.compress_biome_container

1.16 only. Minor optimization borrowed from Hydrogen, which attempts to save space in the biome container when possible. This gets disabled automatically if conflicting mods like BetterEnd or Chocolate are installed.

mixin.perf.datapack_reload_exceptions

All versions. Reduces log spam and possibly slightly improves loading speed by not printing the stacktraces for some commonly thrown exceptions during datapack reload (e.g. missing items in loot tables/recipes). The message is still printed.

mixin.perf.dedicated_reload_executor

All versions. Moves resource pack and data pack reloading to a dedicated worker pool instead of using the default Worker-Main threads. This allows mods to Smooth Boot to still potentially improve singleplayer performance at runtime while not slowing down launch due to a limited thread count.

mixin.perf.deduplicate_location

All versions, but disabled by default due to load time impact. Deduplicates resource location namespaces and paths. This saves RAM but also increases the cost of constructing a new ResourceLocation by quite a bit.

mixin.perf.deduplicate_wall_shapes

Makes most wall blocks share the same shape object instead of each one having its own copy. Can reduce memory usage substantially when lots of wall blocks are added by mods.

mixin.perf.dynamic_dfu

All versions. Modifies DFU initialization to happen the first time something needs to be upgraded. This sounds similar to LazyDFU but is distinctly implemented, as it avoids loading any DFU classes/data structures, while LazyDFU only disables rule optimization. Essentially, this option is a safer version of DataFixerSlayer as it will still load DFU when needed.

You should typically continue to use LazyDFU even with this option enabled, as otherwise DFU rule optimization will cause lag.

mixin.perf.dynamic_resources

All versions. See https://github.com/embeddedt/ModernFix/wiki/Dynamic-Resources-FAQ.

mixin.perf.dynamic_resources.ae2

AE2 compatibility patch for dynamic resources

mixin.perf.dynamic_resources.ctm

CTM compatibility patch for dynamic resources

mixin.perf.dynamic_resources.rs

Refined Storage compatibility patch for dynamic resources

mixin.perf.dynamic_resources.supermartijncore

SuperMartijn642CoreLib compatibility patch for dynamic resources

mixin.perf.dynamic_sounds

All versions. Allows the game to unload sounds, instead of sounds indefinitely persisting after being loaded.

mixin.perf.dynamic_structure_manager

All versions. Allows the game to unload structure files after generation concludes instead of keeping them loaded forever.

mixin.perf.fast_registry_validation

All versions. Forge needlessly looks up a method via reflection every single time a registry is validated. This patch simply caches the returned value since it will be the same every time.

mixin.perf.faster_advancements

Rewrites the advancement checking logic to be faster and not cause StackOverflowError in large packs. Port of Advancements Debug from Fabric.

mixin.perf.faster_command_suggestions

Mitigate lag when there are hundreds of thousands of suggestions while typing a command

mixin.perf.faster_font_loading

All versions. Optimizes the font renderer to load fonts faster, speeding up resource reload.

mixin.perf.faster_item_rendering

All versions. Avoids rendering the sides of items in GUIs. (Yes, vanilla appears to do that.)

This can triple FPS with a mod like REI/JEI installed on weaker GPUs, if enough items are visible. Disabled by default since it's new and not tested much, but should be safe. The most likely issue is items being completely invisible in GUIs, or appearing flat in the world.

mixin.perf.faster_texture_loading

All versions pre 1.19.4. Avoids reading textures twice (the first time using a very slow code path) and instead does one faster load (similar to 1.19.3+).

mixin.perf.faster_texture_stitching

All versions. Enables the game to use a faster texture stitching system originally written by SuperCoder79 for lwjgl3ify on 1.7.10, which can save some time during loading. Rarely, it's been reported to cause weird artifacts on blocks or in GUIs, this may be a Sodium bug.

mixin.perf.fix_loop_spin_waiting

Fixes Minecraft's built-in wait function consuming excessive amounts of CPU resources.

mixin.perf.forge_cap_retrieval

Small micro-optimization that makes retrieving custom entity data slightly more efficient on Forge.

mixin.perf.forge_registry_lambda

Fixes oversights in Forge that lead to excessive allocation in hot registry methods.

mixin.perf.jeresources_startup

1.16 only. Optimizes Just Enough Resources to not needlessly recreate villager entities many times for the same profession, which saves time during JEI startup.

mixin.perf.kubejs

1.16 only. Optimizations to KubeJS to avoid needless ItemStack copying, etc., which reduces the time taken to load datapacks.

mixin.perf.model_optimizations

All versions. Implements optimizations to speed up the model loading process.

mixin.perf.mojang_registry_size

Fixes an issue causing registration of blocks/items to slow down proportional to the number already registered. This improves startup time.

mixin.perf.nbt_memory_usage

All versions. Uses a more efficient backing map for compound NBT tags that deduplicates key names and also uses an array map for very small compounds. This reduces the overhead of storing many compound tags in memory.

mixin.perf.nuke_empty_chunk_sections

1.16 only, inspired by Hydrogen. Avoids storing chunk sections that are full of air in memory, instead marking them as empty.

mixin.perf.patchouli_deduplicate_books

Fix Patchouli books storing many empty items with NBT tags, reducing memory usage.

mixin.perf.reduce_blockstate_cache_rebuilds

All versions. A key optimization. Newer Minecraft versions (after 1.12) implemented a blockstate cache system that caches frequently used information about a blockstate, such as whether it is solid, its collision shape, etc. Rebuilding this cache is quite fast in vanilla (it takes only a second or two) but is quite slow with many mods installed, as there are many more blockstates present in the game which all must have their caches rebuilt.

This problem is exacerbated by Forge as the cache is rebuilt at many points when the data would almost certainly be unused before the next rebuild. Examples include right before reaching the main menu (during the "Freezing data" stage), as well as multiple (!) times when a world is being loaded.

ModernFix solves this performance bottleneck by instead making cache rebuilds lazy. Each blockstate rebuilds its cache the first time the data would be accessed. At any point when vanilla or Forge would attempt to rebuild caches for all blockstates, this is redirected to simply invalidate the cache on each blockstate instead.

This should not have any impact on TPS after startup concludes.

mixin.perf.remove_biome_temperature_cache

All versions. Removes the biome temperature cache as Lithium does on modern versions.

mixin.perf.remove_spawn_chunks

Completely removes spawn chunks from the game. They are no longer loaded at all, unlike Ksyxis.

mixin.perf.resourcepacks

All versions. A key optimization. Launches on modern versions are heavily bottlenecked by filesystem access. Many requests are frequently made to resource packs to list resources or check if a given resource exists, and each of these result in a very slow file API call.

ModernFix completely eliminates most of the bottleneck here by simply caching a listing of all resources that exist within mod-provided and vanilla resourcepacks. The cache is rebuilt on resource reload (except for the vanilla resources, since they should never change while the game is running).

There are no known compatibility issues with this patch except for OptiFine (its CTM resources do not load correctly). However I do not recommend using OptiFine in any scenario, as it adds several minutes to launch time by itself and is not tested with ModernFix at all.

mixin.perf.reuse_datapacks

1.16 only. Attempts to speed up switching between singleplayer worlds by skipping the datapack reload when possible. May cause compatibility issues with some mods, but is currently enabled by default.

mixin.perf.skip_first_datapack_reload

1.16 & 1.19 only. A key optimization.

In the middle of the 1.16 development cycle, Forge patched the game to reload datapacks twice when loading an existing world, in order to fix an issue with biome ID shifting. Unfortunately, datapack reloads often take upwards of 30 seconds and so this very severely affects world loading times.

ModernFix makes the necessary changes to avoid this reload, based on the unfinished Forge PR #8163.

This change was removed by Forge in 1.18, but then a similar patch was added again in 1.19 to fix mod datapacks not being loaded when creating new singleplayer worlds. Fortunately, the issue is localized to the world creation screen in 1.19, and existing worlds only require a single reload. However, this still doubles the length of the lag spike when clicking "Create New World" in 1.19, and so ModernFix again makes changes to not perform a redundant reload.

mixin.perf.state_definition_construct

All versions. Enabled only if FerriteCore is installed. Takes advantage of FerriteCore's handling of blockstates to speed up their creation. This can help speed up launch with mods that add lots of blockstates, such as furniture mods.

mixin.perf.thread_priorities

All versions. Adjusts the worker and server thread priorities to be lower than the client thread. This helps improve FPS stability on machines with few CPU cores, provided that the Java implementation in use respects priorities.

mixin.perf.use_integrated_resources.jepb

mixin.perf.use_integrated_resources.jeresources

mixin.safety

Concurrency patches to prevent crashes during launch

Clone this wiki locally