CraftTweaker No such member: mekanism
enricotagliavini opened this issue ยท 4 comments
Issue description:
When trying to add recipes to mekanism's crusher the script loading fails with "No such member: mekanism", although the mod seems to be correctly detected by looking at the output of /ct mods
Trying to use https://minecraft.curseforge.com/projects/mekanism-pams-harvestcraft-compatibility with CraftTweaker 4.1.11. For each line in the file .zs file starting with mods.mekanism I get an error
[INITIALIZATION][CLIENT][ERROR] 03_pams_harvestcraft_mekanism_crusher.zs:6 > No such member: mekanism
And, at the very end of the log file
[INITIALIZATION][CLIENT][ERROR] 03_pams_harvestcraft_mekanism_crusher.zs:224 > No such member: mekanism
[INITIALIZATION][CLIENT][INFO] Initializing '03_pams_harvestcraft_mekanism_crusher.zs...
[INITIALIZATION][CLIENT][ERROR] [crafttweaker]: Error executing {[0:crafttweaker]: 03_pams_harvestcraft_mekanism_crusher.zs}: Truncated class file
java.lang.ClassFormatError: Truncated class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at stanhebben.zenscript.ZenModule$MyClassLoader.loadClass(ZenModule.java:417)
at 03_pams_harvestcraft_mekanism_crusher.__script__(03_pams_harvestcraft_mekanism_crusher.zs:6)
at __ZenMain__.run(03_pams_harvestcraft_mekanism_crusher)
at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:218)
at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:101)
at crafttweaker.mc1120.events.CommonEventHandler.registerRecipes(CommonEventHandler.java:68)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_671_CommonEventHandler_registerRecipes_Register.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:787)
at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:623)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:742)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:534)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:3929)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Once, but only once, I saw the initialization message from Mekanism after the errors in the client console, so it could be CratfTweaker script loading is running before Mekanism is fully loaded.
Steps to reproduce:
- Install Mekanism and CraftTweaker mod
- Install a script using crusher API to add a recipe, such as 03_pams_harvestcraft_mekanism_crusher.zs from https://minecraft.curseforge.com/projects/mekanism-pams-harvestcraft-compatibility
- start the game, logs will show errors
A shorter version of the script with only three lines for easier testing:
#Pam's HarvestCraft & Mekanism: Pam's HarvestCraft Plants, Seeds, and Saplings now create biofuel:
#author: DarethMC
print("Initializing '03_pams_harvestcraft_mekanism_crusher.zs...");
val biofuel = <mekanism:biofuel>;
mods.mekanism.crusher.addRecipe(<harvestcraft:blackberryitem>, biofuel *3);
mods.mekanism.crusher.addRecipe(<harvestcraft:blackberryseeditem>, biofuel *2);
mods.mekanism.crusher.addRecipe(<harvestcraft:blueberryitem>, biofuel *3);
Version (make sure you are on the latest version before reporting):
Forge: 1.12.2-14.23.5.2768
Mekanism: 9.4.13.349
CraftTweaker: 4.1.11
If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)
CraftTweaker log (including /ct mods output): https://paste.fedoraproject.org/paste/kJQNV1dq2Y~9lwArn-PBPg
Im still not sure what the 0 recipes thing comes from, but the MTLib dep should be added now.
If you can reproduce the 0 recipes thing with a simple script, please crate a new issue.
Ouch, I don't and I see it's mentioned here http://wiki.aidancbrady.com/wiki/Tutorials/CraftTweake
May I suggest to mention it as an optional dependency in curseforge? I usually look at those as a reference, also for optional features.
I'll test again with MTlib installed and let you know, but I suppose this will fix the issue.
Thank you for the help :)
Hi,
Do you have the mod MTLib? It's a required dependency for our CraftTweaker integration.
I think it worked indeed. I did a new profile, started only with Mekanism and Pam's Harvestcraft, added the script and I can create bio fuel using the crushed and Harvestcraft seeds.
There are however very confusing messages in the logs:
[POSTINITIALIZATION][CLIENT][INFO] Adding 0 Mekanism Crusher Recipe(s) for Unknown item
Attached is the full crafttweaker log file just in case you are curious.
crafttweaker.log
So I apologize for the noise and I thank you again for your help.
But I will point out again that this dependency on MTLib is actually mentioned in the wiki page and it's pretty hard to find, hence I would advise to advertise it better. On curseforge you can put optional dependencies as far as I understand, other mods are doing it, so MTLib would be listed from the page you download the jar file from. Mentioning it also in the mod description page would be useful.
Cheers.