Skip to content

v1.1.1

Choose a tag to compare

@joelra joelra released this 04 Apr 06:31
4dfe812

Summary

Rewrites SignEditMixin for better mod compatibility, robustness, and correct environment scoping.

Changes

SignEditMixin.java

  • Change mixin target from ServerGamePacketListenerImpl to SignBlockEntity, injecting at HEAD of updateSignText instead of using a fragile INVOKE-before injection that captured local variables
  • Remove @Shadow, LocalCapture.CAPTURE_FAILHARD, and all now-unneeded imports — the player, isFrontText, and filteredLines are all directly available as method parameters at HEAD
  • Add instanceof ServerPlayer guard so the hook silently no-ops if somehow invoked outside a server context (e.g. future API changes)

private-chests.mixins.json

  • Move SignEditMixin from the shared mixins array to the server array so it is never loaded on the client at all — the correct approach for a purely server-side mixin

Why

The original approach relied on LocalCapture.CAPTURE_FAILHARD to capture locals from inside ServerGamePacketListenerImpl.handleSignUpdate. This is brittle: any obfuscation or bytecode change in that method (or a conflicting mixin from another mod) can cause it to fail hard at startup. Targeting SignBlockEntity.updateSignText directly at HEAD requires no local capture and is far more stable across Minecraft versions and mod combinations.