https://github.com/squeek502/asmhelper
Helper classes for ASM transformations in Minecraft mods
https://github.com/squeek502/asmhelper
Last synced: about 1 month ago
JSON representation
Helper classes for ASM transformations in Minecraft mods
- Host: GitHub
- URL: https://github.com/squeek502/asmhelper
- Owner: squeek502
- License: unlicense
- Created: 2014-10-06T01:30:36.000Z (over 10 years ago)
- Default Branch: javascript
- Last Pushed: 2022-12-01T19:00:19.000Z (over 2 years ago)
- Last Synced: 2025-03-27T01:03:45.456Z (about 2 months ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 24
- Watchers: 5
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ASMHelper
=========A library of functions to help with ASM transformations in Minecraft mods
With Forge > 1.14, [Forge CoreMods](https://github.com/MinecraftForge/CoreMods) are now implemented in Javascript.
This branch is a port of ASMHelper from Java to Javascript in order to make it easier to port mods that used ASMHelper to 1.14+.---
To use the Javascript version, put [asmhelper.js](src/main/javascript/asmhelper.js) in your mod's resources directory and load it in your `initializeCoreMods` function like so:
```js
function initializeCoreMod() {
Java.type("net.minecraftforge.coremod.api.ASMAPI").loadFile("path/to/asmhelper.js");// ASMHelper is now an object in the global namespace
return {
"FoodStatsTransformer": {
"target": {
"type": "CLASS",
"name": "net.minecraft.util.FoodStats"
},
"transformer": function(classNode) {
var internalClass = ASMHelper.toInternalClassName("some.package.IClassName");
classNode.interfaces.add(internalClass);
return classNode;
}
}
}
}
```## Breaking Changes
Some methods that existed in the Java version have not been ported to Javascript. This is either because they are no longer applicable or they simply were not used by AppleCore and so porting them was not worth the effort. Pull requests for any unported functions are welcome!