McJtyMods / InControl

Be In Control of Mob Spawns and others
MIT License
45 stars 16 forks source link

InControl Crashing During "Finishing Up" Stage of Forge Loading #137

Open Natesoccer13 opened 5 years ago

Natesoccer13 commented 5 years ago

I recently added InControl to my modpack in an attempt to control which mobs from Mo' Creatures are able to spawn. However, upon trying to load up the game, it crashes during the "Finishing Up" phase of Forge's loading sequence when it gets to InControl. The only json file I've altered is "spawn" and have pasted what I typed below. I'm very new to coding and what I typed was based on an example shown on the wiki. Any help would be much appreciated! :)

[ { "mob": ["mocreatures:panther", "mocreatures:blackbear", "mocreatures:kitty", "mocreatures:leopard", "mocreatures:lion", "mocreatures:mouse", "mocreatures:ostrich", "mocreatures:wildpolarbear", "mocreatures:horsemob", "mocreatures:hellrat", "mocreatures:manticore", "mocreatures:rat", "mocreatures:werewolf", "mocreatures:wwolf", "mocreatures:fly", "mocreatures:maggot", "mocreatures:roach"], "result": "deny" }, { "passive": true, "result": "default" }, { "result": "default" } ]

McJty commented 5 years ago

Can you show the crash log?

Insane96 commented 5 years ago

Happens to me too after the update (1.12-3.9.12) Crash Log: https://gist.github.com/Insane96/0788ddcc4797d21b0e0a9f3de6122308 spawn.json and potentialspawn.json: https://gist.github.com/Insane96/4c460d088da550b46e5c614f6a6234f9

Natesoccer13 commented 5 years ago

Tried to load the game again today to get the crash report to send to you and everything loaded just fine... (Didn't change any files or anything) ¯_(ツ)_/¯ I'll let you know if the problem arises again, but thanks for responding! :)

Insane96 commented 5 years ago

The problem persist with version 1.12-3.9.13. Same error, same json files

McJty commented 5 years ago

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from InControl (incontrol) Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3 path $

There is an error in your json. Maybe try a json validator

McJty commented 5 years ago

Avoid this:

    "maxcount": "5,thermalfoundation:blizz"

Just use "maxcount": 5

Insane96 commented 5 years ago

Nope, no errors in the JSON. As for maxcount changed to

"maxcount": {
    "amount": 5,
    "perchunk": true
}

And is no longer crashing.

Insane96 commented 5 years ago

Btw I think the game shouldn't crash when there are errors in the JSONs

McJty commented 5 years ago

It's not crashing. It is reporting errors. The only place to do that is in the logs. To ensure people notice this the game 'crashes' because otherwise people are even more confused about rules that are not working

Furious1964 commented 4 years ago

Getting this crash too. How do I go about fixing it and which files do I need to edit?

McJty commented 4 years ago

Check your spawn.json/potentialspawn.json and so on and run them through a json validator (you can find them online). If you examine the crashlog you can find out which of the files is causing a problem

Furious1964 commented 4 years ago

I've examined all of the json files for the mod and they're all valid. Don't know why it still crashes.

McJty commented 4 years ago

Show the crash log then

Furious1964 commented 4 years ago

Here you are: https://pastebin.com/ruTSQC57

McJty commented 4 years ago

From that log you can see that there is a problem in one of your jsons:

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from InControl (incontrol) Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 4 path $ at com.google.gson.JsonParser.parse(JsonParser.java:65) at com.google.gson.JsonParser.parse(JsonParser.java:45)

So one of your jsons is wrong. Maybe you should show them to me

Furious1964 commented 4 years ago

Experience Json: https://pastebin.com/qp2re0Jt Loot Json: https://pastebin.com/6CwnGHNR Potentialspawn Json: https://pastebin.com/ma4PDMv4 Spawn Json: https://pastebin.com/ezwmEknR Summonaid Json: https://pastebin.com/e8TfTwqm

I really appreciate your help with this. Thank you.

McJty commented 4 years ago

Hmm weird. Can't see the problem either. Make a copy of all your jsons and then delete them. See if that fixes the problem. Then put them back one by one

Furious1964 commented 4 years ago

Deleted them all and was able to load and play Sky Factory 4, but all ot the Json files just have [] in them.

hacatu commented 4 years ago

It would be helpful if incontrol printed the json error instead of throwing it, because there are multiple interpretations of "valid json" (eg comments are not strictly permitted but the java json parser used accepts them) and it can crash on spec-valid json so it is very hard to pinpoint the error because only a stack trace appears in the log which does not mention json line numbers.

My error was fixed by upgrading from .10 to .16 fortunately.