Backporting JSON import quest prerequisite resolution to 1.7.10
rockobonaparte opened this issue ยท 2 comments
I have 318 or so quests in my Baby's First Space Race mod pack that I like to edit offline in JSON, but the prerequisites are garbled when I bring them back in. I was assuming it was an issue of the loader just ignoring prerequisites it hadn't yet loaded, and it appears I was correct. It looks like this was actually fixed already. In particular, @way2muchnoise seemed to have instituted a two-stage load process as of 4ed3c37 that I expect addresses it.
So now I'm left with both a good and a bad situation. It's good in that it looks like all is well, but bad in that it looks like I have to take this back to 1.7.10 if I want it to work. Looking at Curse, it looks like the baton got handed over and post 4.4.4 releases are targeting 1.9.4 exclusively. Can somebody pass a long a few tips on the smallest-impact changes I'd have to make to get that fix into 1.7.10?
We have dropped 1.7.10 support. Backporting yourself is ofcourse allowed, and if you PR it in, we will release a new version with that support. We can't possibly maintain for every version and a decision needed to be made. Stay behind on 1.7 and face a few nasty bugs that would require a rewrite, and then rewrite it all for 1.8/1.9 OR rewrite it once for just 1.9. The latter was chosen.
For what it's worth, I was starting to look backwards in the history and trying to get a baseline. My git blame command was implying 4ed3c37 was where postLoad and friends were put in, but I can see it has been in for some time. This might actually be a longer standing problem I have. I tried to reproduce it in the HEAD, but the 'save all' command outright failed:
[13:14:16] [Server thread/WARN]: Couldn't process command: 'hqm save all'
java.lang.ClassCastException: java.util.HashMap cannot be cast to java.util.Collection
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:60) ~[CollectionTypeAdapterFactory$Adapter.class:?]
at com.google.gson.Gson.toJson(Gson.java:593) ~[Gson.class:?]
at com.google.gson.Gson.toJson(Gson.java:572) ~[Gson.class:?]
at hardcorequesting.io.SaveHandler.save(SaveHandler.java:294) ~[SaveHandler.class:?]
at hardcorequesting.commands.CommandSave.save(CommandSave.java:101) ~[CommandSave.class:?]
at hardcorequesting.commands.CommandSave.handleCommand(CommandSave.java:33) ~[CommandSave.class:?]
at hardcorequesting.commands.CommandHandler.execute(CommandHandler.java:80) ~[CommandHandler.class:?]
I think the main problem happens from creating cross-chapter prerequisites. It will even bomb intra-chapter prerequisites, but I think they're tied to the cycles that get created from having some cross-chapter prerequisites. I'll just walk backwards in steps until I can export/import again and see if you all even managed to fix this. If not, maybe I have a patch to make that I can also put on top of 1.7.10. I suspect the fix is completely in HQM internals and doesn't require any Minecraft or Forge-specific APIs, so what I'd have to do probably isn't that big of a deal.