Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModId issue #10

Open
ghost opened this issue Feb 23, 2021 · 4 comments
Open

ModId issue #10

ghost opened this issue Feb 23, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 23, 2021

So currently I am learning ZenStages which is a great mod, however I tried to add a mod to a stage and it won't build at all.
I tried many parameters, with the optional true, and another mod. I also tried by using a static class even if it was in the same file, by naming it differently. However nothing works at all, it's only when I tested with the example of stick that it worked.
image
This is what I have done so far to test the addModId method.

@sam-kirby
Copy link
Contributor

Could you provide your crafttweaker log?

@ghost
Copy link
Author

ghost commented Feb 24, 2021

Yes I just ran it again after trying multiple other scripts, none of them worked.
Here are the logs :

[PREINITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit]]
[PREINITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [preinit]
[PREINITIALIZATION][CLIENT][INFO] [preinit | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: staging\stages.zs} as we are currently loading with a different loader
[PREINITIALIZATION][CLIENT][INFO] Completed script loading in: 3ms
[PREINITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit], [nc_preinit]]
[PREINITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [nc_preinit]
[PREINITIALIZATION][CLIENT][INFO] [nc_preinit | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: staging\stages.zs} as we are currently loading with a different loader
[PREINITIALIZATION][CLIENT][INFO] Completed script loading in: 0ms
[INITIALIZATION][CLIENT][INFO] CraftTweaker: Building registry
[INITIALIZATION][CLIENT][INFO] CraftTweaker: Successfully built item registry
[INITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit], [nc_preinit], [recipeevent | crafttweaker]]
[INITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [crafttweaker | recipeevent]
[INITIALIZATION][CLIENT][INFO] [crafttweaker | SIDE_CLIENT]: Loading Script: {[0:crafttweaker]: staging\stages.zs}
[INITIALIZATION][CLIENT][ERROR] [crafttweaker]: Error executing {[0:crafttweaker]: staging\stages.zs}: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at stanhebben.zenscript.type.natives.JavaMethod.getPriority(JavaMethod.java:349)
at stanhebben.zenscript.type.natives.JavaMethod.select(JavaMethod.java:84)
at stanhebben.zenscript.type.natives.ZenNativeMember$InstanceGetValue.call(ZenNativeMember.java:113)
at stanhebben.zenscript.parser.expression.ParsedExpressionCall.compile(ParsedExpressionCall.java:37)
at stanhebben.zenscript.statements.StatementExpression.compile(StatementExpression.java:27)
at stanhebben.zenscript.statements.StatementExpression.compile(StatementExpression.java:19)
at stanhebben.zenscript.ZenModule.compileScripts(ZenModule.java:152)
at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:218)
at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:105)
at crafttweaker.mc1120.events.CommonEventHandler.registerRecipes(CommonEventHandler.java:73)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_409_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:857)
at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:636)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:747)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)
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:497)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
[INITIALIZATION][CLIENT][INFO] Completed script loading in: 331ms
[POSTINITIALIZATION][CLIENT][INFO] Removing recipes for various outputs
[AVAILABLE][CLIENT][INFO] Fixed the RecipeBook

image
As always it doesn't show it is staged, also when I try in survival it doesn't work of course. I'm really not good at Java errors as I use it almost never, so I hope it will help you and I'm just a bit stupid.

@GalaxyGamerYT
Copy link

I'm getting the same issue with addModId.

Script:
`#priority 500

import mods.zenstages.ZenStager;
import mods.zenstages.Stage;

print("Storage End Stage Loaded");

var storage_end as Stage = ZenStager.getStage("storage_end");

mods.recipestages.Recipes.setRecipeStageByMod("storage_end", "refined_avaritia");
mods.recipestages.Recipes.setRecipeStageByMod("storage_end", "packagedexcrafting");

storage_end.addModId("refined_avaritia");
storage_end.addModId("packagedexcrafting",);'

I asked in the crafttweaker discord and they suggested doing.
storage_end.addModId("refined_avaritia", false, null);

Still an error.

Log: https://pastebin.com/Lb5hNep6

@0xKate
Copy link

0xKate commented Feb 20, 2022

Adding false, null as additional arguments to each call to addModId did not solve the issue for me. I also tried false, [null] and false, [<minecraft:air>] and found that you cannot supply null here and it is not optional. Resulting in the error stack cannot be null.

This does however work when I supply an IIngredient that was part of the mod, for example, Mekansim and ignoring the cardboard box will work.

I was able to work-around by supplying false, [<minecraft:stone>] in the cases where I wanted to stage an entire mod.

Not exactly sure what is going on here but I always get an error about null pointers, stack cannot be null or some other null error no matter what else I try.

Scripts:
https://gist.github.com/0xKate/b950f467745f125d0d5b4dc2542d4f3f

E: Here is the exception I'm getting when I just use null

Exception
[INITIALIZATION][CLIENT][INFO] [crafttweaker | SIDE_CLIENT]: Loading Script: {[101:crafttweaker]: Stages\stages_init.zs}
[INITIALIZATION][CLIENT][ERROR] [crafttweaker]: Error executing {[101:crafttweaker]: Stages\stages_init.zs}: null
java.lang.NullPointerException
  at uk.artdude.zenstages.stager.type.TypeMod.<init>(TypeMod.java:31)
  at uk.artdude.zenstages.stager.Stage.addModId(Stage.java:226)
  at Stages\Stages_init.__script__(Stages\stages_init.zs:30)
  at __ZenMain__.run(Stages\Stages_init)
  at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:240)
  at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:105)
  at crafttweaker.mc1120.events.CommonEventHandler.registerRecipes(CommonEventHandler.java:71)
  at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1436_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:857)
  at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:636)
  at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:747)
  at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)
  at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535)
  at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)
  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)
  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 org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
  at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
  at org.multimc.EntryPoint.listen(EntryPoint.java:143)
  at org.multimc.EntryPoint.main(EntryPoint.java:34)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants