Scope
Investigate replacing Hyxin (SpongePowered Mixin bootstrap) with MixinTale as the bytecode patching framework for HyperProtect-Mixin.
- MixinTale is purpose-built for Hytale — not a port of SpongePowered Mixin
- Its "zero runtime dependency" model (handlers are copied into target classes) eliminates cross-classloader issues that are fundamental to how Hyxin/Sponge Mixin works on Java 21+
- Compile-time annotation processing (
mixintale.index.json) replaces runtime reflection scanning — faster startup, earlier error detection
- Deterministic transform ordering with configurable priority, plus a fail-soft mode (report vs fatal), are both improvements over Sponge Mixin defaults
- Mod JARs go in
Mods/ instead of earlyplugins/ — MixinTale-Bootstrap is the only early plugin needed
Implementation Details
Current Hyxin surface area in HyperProtect-Mixin:
manifest.json: "Hyxin": { "Configs": ["hyperprotect.mixin.json"] } section
hyperprotect.mixin.json: SpongePowered Mixin config listing 22 interceptor classes
HyperProtectConfigPlugin.java: Implements IMixinConfigPlugin (OrbisGuard coexistence, per-mixin gating)
build.gradle: compileOnly "curse.maven:hyxin-1405491:7399430" dependency via CurseMaven
- 22 interceptor classes using SpongePowered annotations:
@Mixin, @Redirect, @Shadow, @Unique, @At
MixinTale annotation mapping (SpongePowered → MixinTale):
| SpongePowered Mixin |
MixinTale Equivalent |
Notes |
@Mixin(Target.class) |
@Patch(Target.class) |
1:1 rename |
@Redirect + @At(INVOKE) |
@RedirectCall or @WrapCall |
RedirectCall replaces callsite; WrapCall wraps via Operation<R> |
@Shadow |
@Accessor |
Generates field/method access into private members |
@Unique |
N/A |
Not needed — handlers are copied into target, no name collision risk |
@Inject (HEAD) |
@Prefix |
Execute at method start |
@Inject (RETURN) |
@Postfix |
Execute at method end, can modify @Result |
| N/A |
@Replace |
Full method body replacement (no Sponge equivalent without Overwrite) |
Migration approach:
- Add
mixintale-api as compile dependency, mixintale-processor as annotation processor
- Port each interceptor one-by-one — the bridge API and verdict protocol remain unchanged
- Replace
HyperProtectConfigPlugin (IMixinConfigPlugin) with MixinTale's priority/ordering system for OG coexistence
- Replace
hyperprotect.mixin.json with auto-generated mixintale.index.json
- Update
manifest.json to remove the "Hyxin" section
- Update installation docs: MixinTale-Bootstrap in
EarlyPlugins/, HyperProtect-Mixin moves to Mods/
- Verify all 20 hooks + 22 interceptors work identically
Key concern — @Redirect equivalence:
HyperProtect-Mixin makes heavy use of @Redirect to intercept specific method calls within target methods (e.g., redirecting removeBlock() inside performPickupByInteraction()). MixinTale's @RedirectCall uses owner/name/desc + ordinal for callsite selection. Need to verify this provides equivalent precision for all 22 interceptor injection points, especially multi-redirect chains like HarvestInterceptor (5 redirects in one method).
Risks and Alternatives
Risks:
- Redirect precision — HyperProtect-Mixin uses multi-stage
@Redirect chains within single methods (e.g., HarvestInterceptor has 5 redirects in performPickupByInteraction). MixinTale's @RedirectCall callsite selection (owner/name/desc/ordinal) needs to support equivalent targeting. If ordinal selection doesn't cover all cases, some interceptors may need architectural changes.
- OrbisGuard coexistence — Current
HyperProtectConfigPlugin uses IMixinConfigPlugin.shouldApplyMixin() to disable 17 conflicting mixins when OG is detected. MixinTale's equivalent gating mechanism needs evaluation — may need to use priority ordering or conditional patching.
- Ecosystem maturity — Hyxin uses SpongePowered Mixin which has years of battle-testing across Minecraft modding. MixinTale is newer and Hytale-specific. Bugs or edge cases in the weaver could affect server stability.
- Breaking change for server operators — Moving from
earlyplugins/ to Mods/ changes the installation workflow. Existing users would need to move their JAR.
- MixinTale-Bootstrap still requires
--accept-early-plugins — so the flag requirement doesn't go away, though server operators no longer need to place HyperProtect-Mixin itself in early plugins.
Alternatives:
- Stay on Hyxin — The current setup works, Hyxin is stable, and SpongePowered Mixin is proven. Migration is only worth it if MixinTale's classloader isolation model solves real pain points.
- Dual support — Maintain both Hyxin and MixinTale builds during a transition period. Adds maintenance burden but reduces risk.
- Wait for maturity — Monitor MixinTale adoption in the Hytale community before committing. If other major mods adopt it, the ecosystem benefit increases.
References and Media
Confirmation Checklist
Scope
Investigate replacing Hyxin (SpongePowered Mixin bootstrap) with MixinTale as the bytecode patching framework for HyperProtect-Mixin.
mixintale.index.json) replaces runtime reflection scanning — faster startup, earlier error detectionMods/instead ofearlyplugins/— MixinTale-Bootstrap is the only early plugin neededImplementation Details
Current Hyxin surface area in HyperProtect-Mixin:
manifest.json:"Hyxin": { "Configs": ["hyperprotect.mixin.json"] }sectionhyperprotect.mixin.json: SpongePowered Mixin config listing 22 interceptor classesHyperProtectConfigPlugin.java: ImplementsIMixinConfigPlugin(OrbisGuard coexistence, per-mixin gating)build.gradle:compileOnly "curse.maven:hyxin-1405491:7399430"dependency via CurseMaven@Mixin,@Redirect,@Shadow,@Unique,@AtMixinTale annotation mapping (SpongePowered → MixinTale):
@Mixin(Target.class)@Patch(Target.class)@Redirect+@At(INVOKE)@RedirectCallor@WrapCallOperation<R>@Shadow@Accessor@Unique@Inject(HEAD)@Prefix@Inject(RETURN)@Postfix@Result@ReplaceMigration approach:
mixintale-apias compile dependency,mixintale-processoras annotation processorHyperProtectConfigPlugin(IMixinConfigPlugin) with MixinTale's priority/ordering system for OG coexistencehyperprotect.mixin.jsonwith auto-generatedmixintale.index.jsonmanifest.jsonto remove the"Hyxin"sectionEarlyPlugins/, HyperProtect-Mixin moves toMods/Key concern —
@Redirectequivalence:HyperProtect-Mixin makes heavy use of
@Redirectto intercept specific method calls within target methods (e.g., redirectingremoveBlock()insideperformPickupByInteraction()). MixinTale's@RedirectCallusesowner/name/desc+ordinalfor callsite selection. Need to verify this provides equivalent precision for all 22 interceptor injection points, especially multi-redirect chains likeHarvestInterceptor(5 redirects in one method).Risks and Alternatives
Risks:
@Redirectchains within single methods (e.g.,HarvestInterceptorhas 5 redirects inperformPickupByInteraction). MixinTale's@RedirectCallcallsite selection (owner/name/desc/ordinal) needs to support equivalent targeting. If ordinal selection doesn't cover all cases, some interceptors may need architectural changes.HyperProtectConfigPluginusesIMixinConfigPlugin.shouldApplyMixin()to disable 17 conflicting mixins when OG is detected. MixinTale's equivalent gating mechanism needs evaluation — may need to use priority ordering or conditional patching.earlyplugins/toMods/changes the installation workflow. Existing users would need to move their JAR.--accept-early-plugins— so the flag requirement doesn't go away, though server operators no longer need to place HyperProtect-Mixin itself in early plugins.Alternatives:
References and Media
compileOnly "curse.maven:hyxin-1405491:7399430"Confirmation Checklist