Skip to content

Runtime AST manipulation framework that lets V-Slice mods use annotations and configs to inject behavior into scripted classes from other mods.

Notifications You must be signed in to change notification settings

Starexify/PolyMixin

Repository files navigation

PolyMixin

Runtime AST Mixin Framework for V-Slice Mods

 

Official Docs

What is PolyMixin ?

PolyMixin is a framework and API for V-Slice mods, built on AST manipulation. It is inspired by the mixin pattern used in projects like SpongePowered Mixin (Minecraft), and allows modders to patch or extend scripted classes without modifying their original scripts.

How does it work ?

PolyMixin hooks into Polymod's scripting system by using the PolymodScriptClass(_abs) and modifying the _cachedFunctionDecls and _cachedFieldDecls. It replaces or transforms the function declarations (FunctionDecl) using the function declaration from another class, which is also a PolymodScriptClass.

Think of it as "hot-swapping" functions at the AST level.

About

Runtime AST manipulation framework that lets V-Slice mods use annotations and configs to inject behavior into scripted classes from other mods.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages