mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-23 06:01:38 -09:00
Fix bad link, add function to manually regenerate bootstrap
This commit is contained in:
parent
4779e00f1c
commit
34607605a2
@ -37,6 +37,8 @@ Methods:
|
||||
- `ModAPI.util.isCritical() : boolean`
|
||||
- Checks wether the thread is in a critical state.
|
||||
- When patching methods, it is good practice to allow the method to resume as usual if this is `true`, to avoid stack implosions. (yes, those are real)
|
||||
- `ModAPI.util.bootstrap() : void`
|
||||
- Regenerate proxies for ModAPI.items, .blocks, .materials, .enchantments
|
||||
- `ModAPI.util.createArray(class, jsArray) : Object[]`
|
||||
- Makes a java array from a class and a javascript array.
|
||||
- The class parameter can be retrieved via reflect: `ModAPI.reflect.getClassById("net.minecraft.util.BlockPos").class`
|
||||
|
1
docs/tutorials/comingsoon.md
Normal file
1
docs/tutorials/comingsoon.md
Normal file
@ -0,0 +1 @@
|
||||
# Coming Soon
|
10
postinit.js
10
postinit.js
@ -843,13 +843,17 @@ globalThis.modapi_postinit = "(" + (() => {
|
||||
return x;
|
||||
}
|
||||
|
||||
const originalBootstrap = ModAPI.hooks.methods[ModAPI.util.getMethodFromPackage("net.minecraft.init.Bootstrap", "register")];
|
||||
ModAPI.hooks.methods[ModAPI.util.getMethodFromPackage("net.minecraft.init.Bootstrap", "register")] = function (...args) {
|
||||
var x = originalBootstrap.apply(this, args);
|
||||
ModAPI.util.bootstrap = function () {
|
||||
ModAPI.items = new Proxy(ModAPI.hooks._classMap[ModAPI.util.getCompiledName("net.minecraft.init.Items")].staticVariables, StaticProps_ProxyConf);
|
||||
ModAPI.blocks = new Proxy(ModAPI.hooks._classMap[ModAPI.util.getCompiledName("net.minecraft.init.Blocks")].staticVariables, StaticProps_ProxyConf);
|
||||
ModAPI.materials = new Proxy(ModAPI.hooks._classMap[ModAPI.util.getCompiledName("net.minecraft.block.material.Material")].staticVariables, StaticProps_ProxyConf);
|
||||
ModAPI.enchantments = new Proxy(ModAPI.hooks._classMap[ModAPI.util.getCompiledName("net.minecraft.enchantment.Enchantment")].staticVariables, StaticProps_ProxyConf);
|
||||
}
|
||||
|
||||
const originalBootstrap = ModAPI.hooks.methods[ModAPI.util.getMethodFromPackage("net.minecraft.init.Bootstrap", "register")];
|
||||
ModAPI.hooks.methods[ModAPI.util.getMethodFromPackage("net.minecraft.init.Bootstrap", "register")] = function (...args) {
|
||||
var x = originalBootstrap.apply(this, args);
|
||||
ModAPI.util.bootstrap();
|
||||
console.log("[ModAPI] Hooked into bootstrap. .blocks, .items, .materials and .enchantments are now accessible.");
|
||||
return x;
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
*/*/ ZXMushroom63's rather large to do list */*/
|
||||
|
||||
Add makeItemStack to LCI [Todo]
|
||||
Fix blocklook.js [In progress]
|
||||
Fix setblocktest.js [In progress]
|
Loading…
x
Reference in New Issue
Block a user