Farmer's Delight

Farmer's Delight

97M Downloads

1.21 - Config Error

SiverDX opened this issue ยท 1 comments

commented

Minecraft version

1.21

Farmer's Delight version

1.2.4

Forge version

21.0.115-beta

Description

Getting the following exception when this mod is present as dependency during data generation

[16:23:38] [main/ERROR] [ne.ne.fm.ja.FMLModContainer/]: Exception caught during firing event: Cannot get config value before config is loaded.
	Index: 0
	Listeners:
		0: net.neoforged.bus.EventListenerFactory$onModifyDefaultComponents/0x0000025701cee400@265d560b
java.lang.IllegalStateException: Cannot get config value before config is loaded.
	at MC-BOOTSTRAP/[email protected]/com.google.common.base.Preconditions.checkState(Preconditions.java:512)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.get(ModConfigSpec.java:1171)
	at TRANSFORMER/[email protected]/vectorwing.farmersdelight.common.event.CommonModBusEvents.onModifyDefaultComponents(CommonModBusEvents.java:20)
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:350)
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:329)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModContainer.acceptEvent(ModContainer.java:177)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.lambda$postEvent$13(ModLoader.java:358)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModList.forEachModInOrder(ModList.java:164)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.postEvent(ModLoader.java:358)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.internal.RegistrationEvents.modifyComponents(RegistrationEvents.java:28)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.data.loading.DatagenModLoader.begin(DatagenModLoader.java:46)
	at TRANSFORMER/[email protected]/net.minecraft.data.Main.main(Main.java:101)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.dataService(CommonLaunchHandler.java:132)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeDataUserdevLaunchHandler.runService(NeoForgeDataUserdevLaunchHandler.java:28)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210)
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69)

[16:23:38] [main/ERROR] [ne.ne.fm.ModContainer/LOADING]: Caught exception during event net.neoforged.neoforge.event.ModifyDefaultComponentsEvent@6a8ca87c dispatch for modid farmersdelight
java.lang.IllegalStateException: Cannot get config value before config is loaded.
	at MC-BOOTSTRAP/[email protected]/com.google.common.base.Preconditions.checkState(Preconditions.java:512) ~[guava-32.1.2-jre.jar%23110!/:?] {}
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.get(ModConfigSpec.java:1171) ~[neoforge-21.0.115-beta.jar%23190!/:?] {re:mixin,re:classloading}
	at TRANSFORMER/[email protected]/vectorwing.farmersdelight.common.event.CommonModBusEvents.onModifyDefaultComponents(CommonModBusEvents.java:20) ~[farmers-delight-398521-5566383.jar%23194!/:?] {re:classloading}
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:350) ~[bus-8.0.1.jar%23147!/:?] {}
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:329) ~[bus-8.0.1.jar%23147!/:?] {}
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModContainer.acceptEvent(ModContainer.java:177) ~[loader-4.0.18.jar%23143!/:4.0] {}
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.lambda$postEvent$13(ModLoader.java:358) ~[loader-4.0.18.jar%23143!/:4.0] {}
	at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {}
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModList.forEachModInOrder(ModList.java:164) ~[loader-4.0.18.jar%23143!/:4.0] {}
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.postEvent(ModLoader.java:358) ~[loader-4.0.18.jar%23143!/:4.0] {}
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.internal.RegistrationEvents.modifyComponents(RegistrationEvents.java:28) ~[neoforge-21.0.115-beta.jar%23190!/:?] {re:classloading}
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.data.loading.DatagenModLoader.begin(DatagenModLoader.java:46) ~[neoforge-21.0.115-beta.jar%23190!/:?] {re:classloading}
	at TRANSFORMER/[email protected]/net.minecraft.data.Main.main(Main.java:101) ~[neoforge-21.0.115-beta.jar%23189!/:?] {re:classloading}
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {}
	at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {}
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136) ~[loader-4.0.18.jar%23143!/:4.0] {}
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.dataService(CommonLaunchHandler.java:132) ~[loader-4.0.18.jar%23143!/:4.0] {}
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeDataUserdevLaunchHandler.runService(NeoForgeDataUserdevLaunchHandler.java:28) ~[loader-4.0.18.jar%23143!/:4.0] {}
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118) ~[loader-4.0.18.jar%23143!/:4.0] {}
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-11.0.4.jar%23125!/:?] {}
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-11.0.4.jar%23125!/:?] {}
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-11.0.4.jar%23125!/:?] {}
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103) [modlauncher-11.0.4.jar%23125!/:?] {}
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74) [modlauncher-11.0.4.jar%23125!/:?] {}
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-11.0.4.jar%23125!/:?] {}
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-11.0.4.jar%23125!/:?] {}
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210) [bootstraplauncher-2.0.2.jar:?] {}
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69) [bootstraplauncher-2.0.2.jar:?] {}
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:32)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:103)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:210)
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:69)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:136)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.dataService(CommonLaunchHandler.java:132)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.NeoForgeDataUserdevLaunchHandler.runService(NeoForgeDataUserdevLaunchHandler.java:28)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:118)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30)
	... 8 more
Caused by: net.neoforged.fml.ModLoadingException: Loading errors encountered:
	- Farmer's Delight (farmersdelight) encountered an error while dispatching the net.neoforged.neoforge.event.ModifyDefaultComponentsEvent event
	  java.lang.IllegalStateException: Cannot get config value before config is loaded.

	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModContainer.acceptEvent(ModContainer.java:181)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.lambda$postEvent$13(ModLoader.java:358)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModList.forEachModInOrder(ModList.java:164)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModLoader.postEvent(ModLoader.java:358)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.internal.RegistrationEvents.modifyComponents(RegistrationEvents.java:28)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.data.loading.DatagenModLoader.begin(DatagenModLoader.java:46)
	at TRANSFORMER/[email protected]/net.minecraft.data.Main.main(Main.java:101)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	... 14 more 

Steps to reproduce

No response

Mod list

N/A

Logs

No response

Minimal instance

  • I have tested this on a minimal instance

Performance and shader mods

  • I am using performance or shader mods
commented

This is caused by a very recent change to NeoForge, where ModifyDefaultComponentsEvent was moved to run during datagen (I'm not sure why). Since I use configs in this event, it crashes with datagen.

You can roll back NeoForge to version 21.0.114-beta for now, and datagen should work again. I will add a datagen check in the event on version 1.2.5 later.