promotional bannermobile promotional banner

NTGL Mixin fixes

Runtime mixin fixes for NTGL NullPointerException crashes

 


Apocalypse Crash Fixes

A tiny, focused compatibility patch for ntgl (NukaTeam's Gun Lib) and NukaCraft on NeoForge 1.21.1. It fixes two client-side NullPointerException crashes without modifying either mod's jar file — everything is applied at runtime via Mixin, so it stays safe across mod updates and passes launcher file-integrity checks.

What it fixes

1. Client crash on join / weapon reload race condition

ClientPlayHandler.handleUpdateProjectile calls NetworkProjectileManager.get().update(...) with no null-check. NetworkProjectileManager's singleton instance is only set once a reload listener registers it (triggered client-side when a weapon is first interacted with). If the server's projectile-sync packet (S2CMessageUpdateProjectiles) arrives before that registration finishes — most commonly right after joining a world — get() returns null and the client crashes instantly.

Fix: the packet handler now skips the update instead of crashing when the manager isn't ready yet.

2. Power armor first-person render crash (missing forearm bone)

PowerArmorHandRenderer (NukaCraft) looks up two GeckoLib bones per arm when rendering your own forearm in first person: the main *_forearm_armor bone and an optional *_forearm_back_armor detail bone. Not every power armor tier's model defines the optional back-armor bone. When it's missing, the lookup returns null, which gets passed straight into the cube renderer and crashes. This reliably crashed the client the moment you looked at your own arm/hand while wearing certain power armor pieces.

Fix: the render call is now skipped for that specific optional bone instead of crashing. The main forearm armor piece renders exactly as before; only the missing decorative detail is (harmlessly) skipped for models that don't define it.

How it works

Both fixes are implemented as @Inject(at = @At("HEAD"), cancellable = true) Mixins that add a null-check and bail out early — nothing is patched inside ntgl's or NukaCraft's own jars. The mixin config is non-required, so if a future update changes these method signatures, this mod logs a warning and skips that fix instead of crashing your game.

Requirements

  • NeoForge 1.21.1 (tested on 21.1.250)
  • ntgl (NukaTeam's Gun Lib) 3.2.0
  • NukaCraft (for fix #2 — fix #1 applies even without it)
  • GeckoLib (for fix #2)

Side

Client only. Both bugs are purely client-side; safe to leave out of a dedicated server's mods folder.

Compatibility notes

This is a defensive compatibility patch, not an official ntgl/NukaCraft release. If either mod fixes these crashes upstream, this mod becomes a harmless no-op.

NTGL Mixin fixes Team

profile avatar
  • 3
    Followers
  • 3
    Projects
  • 1.3K
    Downloads

Hi! im ciabba. i love Minecraft mobs and tames in general! look forward to my mods/modpacks

More from Ciabba1970