Jump to content

[1.16.4] Config Problem


dun

Recommended Posts

Hello! It's me again!

I'm trying to make a Config file for my mod, but for some reason every time I tried to run the game, it crashes.

Here's What it keeps on saying:

Quote

Description: Rendering overlay

net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file firenblood-common.toml of type COMMON for modid firenblood
    at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:60) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.config.ConfigTracker.openConfig(ConfigTracker.java:104) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.config.ConfigTracker.lambda$loadConfigs$1(ConfigTracker.java:83) ~[forge:?] {re:classloading}
    at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_261] {}
    at java.util.Collections$SynchronizedCollection.forEach(Collections.java:2064) ~[?:1.8.0_261] {}
    at net.minecraftforge.fml.config.ConfigTracker.loadConfigs(ConfigTracker.java:83) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:203) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$startModLoading$7(ClientModLoader.java:132) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:132) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$onResourceReload$2(ClientModLoader.java:114) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
    at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640) ~[?:1.8.0_261] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) ~[?:1.8.0_261] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:289) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172) ~[?:1.8.0_261] {}
Caused by: com.electronwill.nightconfig.core.io.ParsingException: Invalid bare key: =
    at com.electronwill.nightconfig.toml.TableParser.parseKey(TableParser.java:175) ~[toml-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.toml.TableParser.parseDottedKey(TableParser.java:145) ~[toml-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:55) ~[toml-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:101) ~[toml-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:88) ~[toml-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:37) ~[toml-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:113) ~[core-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:219) ~[core-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:202) ~[core-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.load(WriteSyncFileConfig.java:73) ~[core-3.6.2.jar:?] {}
    at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.load(AutosaveCommentedFileConfig.java:85) ~[core-3.6.2.jar:?] {}
    at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:56) ~[forge:?] {re:classloading}

Can someone help explain what I'm doing wrong?

Here's the image of the Config Code

Edited by dun
Added Image
Link to comment
Share on other sites

I've updated my mod to 1.16.5, but still crashes:

Quote

Description: Mod loading error has occurred

java.lang.Exception: Mod Loading has failed
    at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:85) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:188) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:513) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.util.Util.acceptOrElse(Util.java:323) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:509) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.ResourceLoadProgressGui.render(ResourceLoadProgressGui.java:113) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:493) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1003) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_261] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_261] {}
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_261] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108) [forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {}

The code remains the same as in the picture link.

Link to comment
Share on other sites

Unfortunately, it still crashes before fully loaded.

I've tried to change the value on my main mod file from this:

https://imgur.com/2EFX7Xh

to this:

https://imgur.com/2EFX7Xh

At first it seemed to worked, but it ended up generating two files:

https://imgur.com/pvcHv5U

and when I booted up the game again, it crashed once more:

Quote

Description: Mod loading error has occurred

java.lang.Exception: Mod Loading has failed
    at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:85) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:188) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:513) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.util.Util.acceptOrElse(Util.java:323) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:509) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.ResourceLoadProgressGui.render(ResourceLoadProgressGui.java:113) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:493) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1003) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_261] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_261] {}
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_261] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108) [forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
    at com.electronwill.nightconfig.toml.TableParser.parseKey(TableParser.java:175) ~[toml-3.6.3.jar:?] {}
-- MOD firenblood --
Details:
    Mod File: main
    Failure message: Fire N' Blood (firenblood) has failed to load correctly
        com.electronwill.nightconfig.core.io.ParsingException: Invalid bare key: =
    Mod Version: 1.16.4 - 1.2.0
    Mod Issue URL: https://github.com/Polarice3/FireNBlood/issues
    Exception message: com.electronwill.nightconfig.core.io.ParsingException: Invalid bare key: =
Stacktrace:
    at com.electronwill.nightconfig.toml.TableParser.parseKey(TableParser.java:175) ~[toml-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.toml.TableParser.parseDottedKey(TableParser.java:145) ~[toml-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:55) ~[toml-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:101) ~[toml-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:88) ~[toml-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:37) ~[toml-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:113) ~[core-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:219) ~[core-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:202) ~[core-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.load(WriteSyncFileConfig.java:73) ~[core-3.6.3.jar:?] {}
    at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.load(AutosaveCommentedFileConfig.java:85) ~[core-3.6.3.jar:?] {}
    at com.Polarice3.FireNBlood.FNBConfig.loadConfig(FNBConfig.java:34) ~[?:?] {re:classloading}
    at com.Polarice3.FireNBlood.FireNBlood.<init>(FireNBlood.java:78) ~[?:?] {re:classloading}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_261] {}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_261] {}
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_261] {}
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_261] {}
    at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_261] {}
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[forge:36.2] {re:classloading}
    at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[forge:?] {re:classloading}
    at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640) ~[?:1.8.0_261] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) ~[?:1.8.0_261] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:289) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_261] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172) ~[?:1.8.0_261] {}
 

My first clue goes to this specific line:

Quote

Invalid bare key: =

Which I think means that the reason why it kept crashing is due to a stray "=" in the config files! Unfortunately, if that's the case then I'm not sure how to properly fix it as the "=" is autogenerated in the file as it's part of the define function in the config class. 

Link to comment
Share on other sites

I HAVE FOUND THE PROBLEM.

The boolean part of my config is what's causing the crashes! Once I've disabled the boolean part, not only does my game not crash upon starting, but my Config actually worked!

https://imgur.com/ZXFX1kC

For some reason, whenever the Config file is generated, the boolean part looks like that. It seems the format is what's causing the crashes.

This seems like the obvious source of my problems, but I recalled disabling this part before and it was still crashing. I think that updating to 1.16.5 made it so that disabling that part makes the Config work.

I'm not sure why it generates like that, but it seems for the foreseen future, my config would primarily be in Integers.

Link to comment
Share on other sites

22 hours ago, diesieben07 said:

You have named your config entry that, which is not valid.

Why do you have that loadConfig method? Please remove it.

When I remove it, my Config doesn't work. As in, if I change my value from 10000 to 1000, the game would not register the change without the loadConfig method. It's only when the method is called that the game registers the change.

Link to comment
Share on other sites

I tried to remodel my Config code into the Community Wiki's version:

https://imgur.com/bjSKs5a

and have called registerConfig for my code:

https://imgur.com/etIjhTT

But for some reason, when I change the value of my file, the game wouldn't register the change. It will always call the default value instead of the change value.

I even followed changed my Config code to something similar to this:

Here's my version: https://imgur.com/muWhCHG

But again, it only calls the default value for my Config Integer.

It only calls the changed value when I use the loadConfig method. Otherwise, it'll generate the file and ignore any modifications and use the default value.

I have no clue why it cannot change values without the method. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.