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

Registry example throws "Cannot invoke "net.minecraftforge.fml.ModList.getModContainerById(String)" because the return value of "net.minecraftforge.fml.ModList.get()" is null" #21

Closed
IMB11 opened this issue Sep 7, 2022 · 3 comments

Comments

@IMB11
Copy link

IMB11 commented Sep 7, 2022

When running forge client, Cannot invoke "net.minecraftforge.fml.ModList.getModContainerById(String)" because the return value of "net.minecraftforge.fml.ModList.get()" is null is thrown as an error

@IMB11
Copy link
Author

IMB11 commented Sep 7, 2022

Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.8/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:32)
	at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.8/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
	at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.8/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)
	at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.8/cpw.mods.modlauncher.Launcher.run(Launcher.java:106)
	at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.8/cpw.mods.modlauncher.Launcher.main(Launcher.java:77)
	at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.8/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
	at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.8/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
	at cpw.mods.bootstraplauncher@1.1.2/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: java.lang.reflect.InvocationTargetException

	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at MC-BOOTSTRAP/fmlloader@1.19.2-43.1.3/net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:25)
	at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.8/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30)
	... 7 more
Caused by: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
	at MC-BOOTSTRAP/fmlloader@1.19.2-43.1.3/net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(BackgroundWaiter.java:29)
Caused by: java.lang.RuntimeException: java.lang.ExceptionInInitializerError

	at TRANSFORMER/minecraft@1.19.2/net.minecraft.client.main.Main.run(Main.java:145)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.client.main.Main.main(Main.java:51)
	... 13 more
Caused by: java.lang.ExceptionInInitializerError
Caused by: java.lang.ExceptionInInitializerError

	at TRANSFORMER/minecraft@1.19.2/net.minecraft.world.item.AxeItem.handler$zza000$addStrippables(AxeItem.java:521)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.world.item.AxeItem.<clinit>(AxeItem.java:24)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.world.item.Items.<clinit>(Items.java:757)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.world.item.Item.byBlock(Item.java:82)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.world.level.block.Block.asItem(Block.java:476)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorPresets$Bootstrap.register(FlatLevelGeneratorPresets.java:67)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorPresets$Bootstrap.run(FlatLevelGeneratorPresets.java:71)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorPresets.bootstrap(FlatLevelGeneratorPresets.java:33)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.data.BuiltinRegistries.lambda$internalRegister$2(BuiltinRegistries.java:87)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.data.BuiltinRegistries.lambda$static$3(BuiltinRegistries.java:114)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.data.BuiltinRegistries.<clinit>(BuiltinRegistries.java:113)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.core.Registry.<clinit>(Registry.java:665)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.server.Bootstrap.bootStrap(Bootstrap.java:43)
	at TRANSFORMER/minecraft@1.19.2/net.minecraft.client.main.Main.lambda$run$0(Main.java:145)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraftforge.fml.ModList.getModContainerById(String)" because the return value of "net.minecraftforge.fml.ModList.get()" is null
	at LAYER PLUGIN/fmlcore@1.19.2-43.1.3/net.minecraftforge.fml.ModLoadingContext.getActiveContainer(ModLoadingContext.java:31)
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraftforge.fml.ModList.getModContainerById(String)" because the return value of "net.minecraftforge.fml.ModList.get()" is null

	at TRANSFORMER/deeperdarker@0.0NONE/com.kyanite.deeperdarker.platform.ForgeRegistrationFactory.create(ForgeRegistrationFactory.java:21)
	at TRANSFORMER/deeperdarker@0.0NONE/com.kyanite.deeperdarker.platform.RegistrationProvider$Factory.create(RegistrationProvider.java:109)
	at TRANSFORMER/deeperdarker@0.0NONE/com.kyanite.deeperdarker.platform.RegistrationProvider.get(RegistrationProvider.java:50)
	at TRANSFORMER/deeperdarker@0.0NONE/com.kyanite.deeperdarker.registry.blocks.DDBlocks.<clinit>(DDBlocks.java:31)
	... 20 more

@IMB11
Copy link
Author

IMB11 commented Sep 7, 2022

@jaredlll08
Copy link
Owner

Report to Forge, as far as MultiLoader is concerned, everything is working fine, your Common code is being pulled into the Forge code before it is built, the game runs using both Common and Forge code, and anything that happens after that (while the game is running) is usually an issue with the loaders themselves, or with your code specifically.

@jaredlll08 jaredlll08 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2022
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

2 participants