PatchLib - Bug Fixes, Crash Fixes & Mod Compat

A configurable collection of bug fixes, crash fixes and compatibility patches for mods like Tom's Simple Storage, Create, Vampirism, Toxony, Prickle and Arclight. Every patch auto-skips when the mod isn't installed. Stabilize your modpack or server.

PatchLib is a random assortment of bug fixes, crash fixes and compatibility patches for various mods — Farmer's Delight, Tom's Simple Storage, Vampirism, Toxony, Create, Sable, KubeJS, Arclight and more.

I originally built it just to stop the servers I run from crashing. Over time it grew into a proper little library of fixes, and at some point it stopped making sense to keep it to myself — if one of these crashes has cost you a server restart at 2 AM, this is for you.

Patches only run when they are actually needed

This is the part that matters if you maintain a modpack. PatchLib never touches a mod you do not have installed. Before a single patch is applied, it checks:

  • Is the target mod installed? If not, the patch is skipped — no errors, no log spam.
  • Is the mod version actually affected? Several fixes are bound to the exact versions that carry the bug. Update the mod past it and the patch quietly steps aside instead of fighting the official fix.
  • Does another mod already patch this? Known conflicts disable the patch automatically.
  • Is this the right side? Client-only fixes are never loaded on a dedicated server, and the Arclight fixes never on a client.
  • Is it a diagnostic or an experiment? Those are opt-in and stay off until you switch them on.

Every decision is printed on startup, so you always know what is running:

[PatchLib] --- Patch Status Report (dedicated server) ---
[PatchLib]  compat.create_contraption_collider [...] -> ACTIVE
[PatchLib]  farmersdelight.tag_load_order      [...] -> SKIPPED (target not present)
[PatchLib]  debug.connection_probe             [...] -> DISABLED (by config)
[PatchLib]  patchouli.book_registry_lookup     [...] -> SKIPPED (not loaded on this side)
[PatchLib] --- 5 of 28 patches active ---

Drop it into a pack with none of the target mods and all it does is print that report.

Included fixes

Crash fixes

Mod What it fixes
Sable / Create Aeronautics Rapier native panic: No center of mass for body! — a physics sub-level without solid blocks reached the physics engine with no mass data, and the next physics tick took the server down. PatchLib fixes the cause by giving such a sub-level its plot origin as centre of mass.
Sable (safety net) When a physics panic still arrives as a Java exception, Sable turns it into a server crash. PatchLib catches it instead, repairs the state Sable leaves behind on that path and runs Sable's own sub-level recovery. Panics that abort natively cannot be caught from Java at all — that is why the fix above goes after the cause.
Wetland Whimsy IllegalStateException: Adding duplicate value — its decorated pot patterns were registered twice, which aborted RegisterEvent and rolled every registry back to vanilla.
Tom's Simple Storage IllegalStateException: Do not call getCapability on an invalid cache crashing the tick loop from InventoryConnectorBlockEntity. A retired capability cache is now treated as an empty inventory.
Toxony Thrown Oil Pot crashing with a null itemStack after a chunk reload or restart — the stack is now saved to NBT, and onHit is guarded.
Prickle / PigPen Unreadable config aborting the whole datapack load, leaving the server hung at startup. Falls back to defaults, keeps a copy of the broken file, and lets the config heal itself.
Prickle Config format flipping between runs because the property adapters are resolved through the thread context classloader. Now resolved deterministically.
Portable Tanks NullPointerException when a tank item has no fluid NBT.
KubeJS ClassCastException during capability registration and server script loading when a pack registers builders of mixed types.
Vampirism NullPointerException in ActionHandler.deactivateAllActions on hybrid servers.

Arclight / hybrid server fixes

  • ClassCastException when modded entities run Villager AI tasks
  • NullPointerException in Brain.tick from Arclight's villager career redirect
  • ClassCastException mapping Friends & Foes entities to Bukkit wrappers
  • VanillaBackport: startup crash — its ThrownEggMixin finds nothing to inject into in Arclight's rewritten ThrownEgg.onHit. PatchLib takes that one mixin off and sets the hatched chicken's variant itself.
  • Blueprint: crash on the first structure load — its StructureStart injector no longer matches Arclight's rewritten placeInChunk. PatchLib disarms only that injector and feeds Blueprint's repaletters from a spot that still exists.

These only load when Bukkit classes are present, so they are inert on plain NeoForge. The VanillaBackport and Blueprint fixes remove exactly one mixin or injector of the other mod and take over its job; both say so in the log when they do.

Compatibility & behaviour fixes

Mod What it fixes
Create NullPointerException in ContraptionCollider when a movement axis is null
YUNG's Better End Island Ender Dragon being spawned twice
Farmer's Delight Tag keys left null by mod load order
Copper Age Backport Copper armour registered without durability
Subtle Effects End Remastered portal frame ticker never firing
Just Enough Resources (client) Modded biomes missing from JER tabs
Patchouli (client) Modded book cover items failing to resolve

Opt-in tools (off by default)

These do not target any particular mod, so they would run in every pack — which is exactly why they stay off until you set them to true in the config:

Key Side What it does
debug.connection_probe server Logs every player's connection state once a second (open, writable, bytes waiting, queued packets). For hunting down "player freezes, then times out". Very noisy — switch it off again afterwards.
sleep.entity_resync server While someone sleeps, re-sends the position of mobs near players so clients stop drawing them somewhere they are not. A workaround, not a fix.
client.desync_snap client Snaps an entity to its server position when the client has drifted more than 2 blocks away, instead of easing towards it. A symptom brake.
client.sleep_desync_probe client Measures how long incoming packets wait on the client and how far entities have drifted, then prints a verdict. Diagnostic only.

Operators also get /patchlib testpanic [ticks]: it makes the next physics ticks fail on purpose, so you can prove the Sable safety net works before a real crash does. Heads-up: the first failed tick already starts Sable's sub-level recovery, which anything flying will notice.

Version-bound patches

A few fixes only apply to the mod versions that actually carry the bug. If your version is newer, PatchLib reports the patch as skipped — that is intended, not a failure:

Patch Applies to
Farmer's Delight — tag load order 1.3.1 only
KubeJS — builder casts below 2101.7.2 (and disabled when KubeJS Tweaks is present)
Copper Age Backport — armour durability 0.1.4 and older
Subtle Effects — End Remastered ticker 1.11.0 only
Wetland Whimsy — pot patterns registered twice below 2.0.4

Everything else applies to any version of its target mod.

Configuration

Every patch has its own toggle in config/patchlib-patches.properties. The file is generated on first launch with one commented entry per patch:

# --- toms_storage ---
# Treats a retired NeoForge BlockCapabilityCache as an empty inventory instead of throwing
# IllegalStateException out of InventoryConnectorBlockEntity ticking
toms_storage.stale_capability_cache=true

# --- debug ---
# Logs every player's connection state once a second (...). Very noisy
# Opt-in: off unless set to true here.
debug.connection_probe=false

If a fix ever conflicts with something, turn off that one line — no need to remove the mod. When you update PatchLib, new patches are added to your existing file and every value you already set is kept.

Sides

PatchLib is a server-side mod, optional on the client. It registers no network packets and no registry entries, so players without it can join your server normally. Installing it on the client as well adds the two client-side fixes on top, plus the two opt-in client tools if you want them.

Requirements

  • Minecraft 1.21.1
  • NeoForge 21.1+
  • No dependencies

Credits

The Farmer's Delight, Portable Tanks, Copper Age Backport, Subtle Effects, KubeJS and Just Enough Resources fixes are ported from Monkey Patches by iamthemcmaster (LGPL). Thank you!

⚠ Please read before reporting

These patch bugs in other people's mods. As those mods update, some of these issues will be fixed properly at the source. Where I know the affected version range, PatchLib disables the patch automatically once you update past it — but I cannot predict every future release. If a mod fixes something natively and the patch gets in the way, just set it to false in the config.

Bug reports about the patches themselves are very welcome. Bug reports about the patched mods belong to their authors.

PatchLib - Bug Fixes, Crash Fixes & Mod Compat Team

profile avatar
  • 7
    Followers
  • 22
    Projects
  • 274.8K
    Downloads

I mostly build mods to fix problems I run into myself. I share them here in case they help your modpacks and servers too. (we don't talk about SeedRay).

More from epicskydexView all