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

Error/Bug: Configs not loading properly. After first generation #55

Closed
SirAron111 opened this issue Jul 10, 2019 · 24 comments

Comments

@SirAron111
Copy link

commented Jul 10, 2019

I found out trough recent testing and player reports, a certain bug. Certain materials lose traits and material parts vanish completely when loading the game for the second time (after configs have generated).

So I have been using for the test all the mods I have in my pack in a separately made instance.
I used Tinkers construct (of course), conarm, armory expansion, ice and fire, botania, draconic evolution and plustTIC, yoyos. And also tested it with just the tinkers mods and yours not using any other mods that are not tinkers related.

All materials from botania and all materials from plustic lose the material traits. And for some parts the integrated parts even vanish. Like the chaotic laser medium or other wyvern/awakened/chaotic materials same for botania parts. The Armor Parts are still there (not having any traits but all common tool parts or integration of tool parts are gone)

So what I think is happening is there is an error in the generated configs. And how they load in and overwrite the existing materials added by any other tinkers mod and the traits keeping only the newly added armor parts (who then also mostly miss traits).

Here are some pictures how the traits normaly are.
2019-07-10_13 50 07
2019-07-10_13 50 08
2019-07-10_13 50 10
2019-07-10_13 50 12

And here are some pictures showing that after materials lose parts (easy to see in jei) standart manyulin still has all parts to show the difference
2019-07-10_14 17 52
2019-07-10_14 17 13
2019-07-10_14 17 25
2019-07-10_14 17 34
2019-07-10_14 17 42

and lastly some pictures of the missing traits for some materials (there are more tought didnt make pictures for all) and for some reason it registers materials from mods that arent even isntalled like thaumium or psigem or twilight forest or others. (in the test instance whit only the tinkers related mods)
2019-07-10_14 18 20
2019-07-10_14 18 28
2019-07-10_14 18 51
2019-07-10_14 18 54
2019-07-10_14 19 00
2019-07-10_14 19 02

@SirAron111 SirAron111 changed the title Error/Bug: Conflict with the Natura Mod. Error/Bug: Configs not loading properly. After first generation Jul 10, 2019

@SirAron111

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

After further testing i came to the point of noticing that it wasn’t natura causing the problems (I just noticed it first on this mod when I was changing things around)
This issue actually happens on everything.

What actually happens is that when freshly installing armory expansion and no configs are generated yet it will have when immediately starting to play still all materials (loading of materials before armory expansion generates configs or at least parts of the configs get ignored on first load as they generate before the mod checks for the changes in the configs)

But then after exiting the world and closing the client and then restarting it (configs have already been generated at this point so the mod now checks for the changes in these propbably) suddenly a lot of materials are just gone and a lot of traits are lost (issue as explained in above pictures)
So I think what happens is that whenever there are already configs generated it overwrites all standard traits and materials parts from mods that aren’t the main mods (TiC and Conarm) so basically all mods affected I could list are these :

All botania materials / all natura materials / all PlusTiC parts made from PlusTiC added materials like the Draconic Materials (chaotic awakened wyvern etc). Extra util materials natura materials and basically anything in the conarmconfigs that generate in the armory expansion folder.

Here are some pictures showing that the affected materials also don’t show the normal ingots and items they are made from but only the nuggets/shards instead (from the standart TiC book, the Conarm book and the yoyos book (yoyosmod adds tinkers yoyos this bug also happens witouth it but its also affected from it so i listed it)) Only ice and fire integration works mostly fine with or without modified config for them Probably because they are only added by your mod anyway so they aren’t influenced anyway. It also shows the materials for these parts as the items and not chunks/nuggets.
2019-07-10_15 54 01
2019-07-10_15 54 09
2019-07-10_15 54 24
2019-07-10_15 54 25

@SirAron111

This comment has been minimized.

Copy link
Author

commented Jul 10, 2019

Mods list for testing
the non tinkers mods like RF flux or baubles are autodownloaded by other mods ice and fire isnt in there but it also happens with that mod had it moved out for testing once when i made the picture

@SirAron111

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

have some logs if they help from the second time loading up the game (after having the configs generated closing the game and loadign it up with already generated configs (themoment the materials parts and traits start to go missing))
Dont know if this is going to be of any help but if you need mroe info just let me know https://pastebin.com/DupGRyfa
Second load up part 2.txt
Second load up part 1.txt

@Glendening

This comment has been minimized.

Copy link

commented Aug 18, 2019

Just wanted to say we have noted this error in the All the Mods 3 Remix pack. I'm going to go reference this issue over there now.

@NickelHub

This comment has been minimized.

Copy link

commented Aug 18, 2019

Has anyone found a workaround so far?

@Glendening

This comment has been minimized.

Copy link

commented Aug 18, 2019

Only workaround so far is to delete the Armory expansion configs every time they are created (every time you load the game). This prevents you from loading any custom configurations but if you just want it to work with its base settings it will this way.

@YaibaToKen

This comment has been minimized.

Copy link
Owner

commented Aug 19, 2019

Till I find a proper fix, all I can do is push a toggle for the config generation, disabled by default. While it won't fix custom configs, it'll keep the config folder clean and solve the issue for those using the default values.

@Glendening

This comment has been minimized.

Copy link

commented Aug 19, 2019

If there are any logs or tests we can provide you with to help track this down let us know.

@YaibaToKen

This comment has been minimized.

Copy link
Owner

commented Aug 19, 2019

It's mostly a debugging problem, I'll have to analyze the loading process step by step to see where I'm overriding what I shouldn't.

@SirAron111

This comment has been minimized.

Copy link
Author

commented Aug 19, 2019

ye until the fix is ready just do what i did disable the conarm integration in the .cfg and simply only use the dragon parts and make custom ones via json for whatever you need. The dragon parts work great thought.

@Glendening

This comment has been minimized.

Copy link

commented Aug 26, 2019

Just a little note from debugging. Last version in which the items in question worked consistently was 1.2.5

@NickelHub

This comment has been minimized.

Copy link

commented Aug 27, 2019

Here is what I found out. If you look in the log, you can see that the materials have been registered but that "stats for" is missing. This are exactly the disappearing materials.
Full log: https://pastebin.com/R7eAnFQW

[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done loading config from local JSON file
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done loading config from source
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done loading all materials from local JSON files
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done loading all materials from source
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done loading all ore dictionary entries from local JSON files
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done loading all ore dictionary entries from source
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done loading all alloys from local JSON files
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done loading all alloys from source
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done saving config to local JSON file
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done saving all materials to local JSON files
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done saving all ore dictionary entries to local JSON files
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Done saving all alloys to local JSON files
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered tinker's material {awakened_plustic};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered tinker's material {bloodwood_plustic};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered tinker's material {darkwood_plustic};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered tinker's material {ancient_metal};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered tinker's material {chaotic_plustic};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered tinker's material {fusewood_plustic};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered tinker's material {tar_slime};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered tinker's material {ghostwood_plustic};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered stats for tinker's material {blackquartz_plustic};
[14:27:19] [Client thread/INFO] [armoryexpansion-conarm]: Registered stats for tinker's material {awakened_plustic};

@grundyboy34

This comment has been minimized.

Copy link

commented Sep 2, 2019

Can confirm from testing between version 1.2.5 and any version 1.3.0 that if conarm integration is off, tool materials are unaffected. If conarm integration is on, tool materials become missing. However, if you change the "material" flag to false for any armor inside of armoryexpansion/conarm-config.json, then that armor will no longer be registered and the tool material will still exist.

@NickelHub

This comment has been minimized.

Copy link

commented Sep 2, 2019

@grundyboy34 If I get you right, you mean if I turn off Natura stuff etc., it will appear again in Materials and You?

@grundyboy34

This comment has been minimized.

Copy link

commented Sep 2, 2019

Yes, from what I tested that's the case. Currently the options are to either get it working as a tool material or an armor material. Anything inside of conarm-config.json with the material flag set to true seems to get rid of the tool material, leaving only the armor material as long as conarm integration is on.

@NickelHub

This comment has been minimized.

Copy link

commented Sep 2, 2019

By all appearances, you were correct. All my six materials reappeared.

@grundyboy34

This comment has been minimized.

Copy link

commented Sep 2, 2019

In the spirit of solving this, here's another noticed interaction.
Wiping conarm-materials.json to just contain "[ ]" causes everything to load as it should, except that conarm-materials.json is autofilled again causing the next load to experience the bug.
Doing this with conarm-config.json just results in the bug still being there, so I'm fairly certain this is happening somewhere that conarm-materials.json is loaded.

@grundyboy34

This comment has been minimized.

Copy link

commented Sep 2, 2019

I'm fairly certain the problem is here. If you change the method to immediately return, the bug never occurs. (and of course material configs aren't loaded)

@grundyboy34

This comment has been minimized.

Copy link

commented Sep 2, 2019

Fixed it, I'll make a pull request. Although, I had to drop ice and fire to 1.7 in order for gradle to find it.
Without a pull request, the fix is simply commenting out three lines as such in this file. This still allows the conarm-materials.json values to be tweaked and used.
https://github.com/YaibaToKen/Armory-Expansion/blob/master/src/main/java/org/softc/armoryexpansion/common/integration/modsupport/ConArmIntegration.java

 @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        this.modid = ConstructsArmory.MODID;
        this.logger = event.getModLog();
        this.configDir = event.getModConfigurationDirectory().getPath();
        if (ArmoryExpansion.isIntegrationEnabled(modid)){
            this.loadMaterialsFromOtherIntegrations(event);
            this.setIntegrationData(this.configDir);
            this.integrationConfigHelper.syncConfig(this.materials);
            this.saveIntegrationData(this.configDir);
           // this.registerMaterials();
           // this.registerAlloys();
           // this.registerMaterialStats();
        }
        ArmoryExpansion.config.save();
    }
grundyboy34 added a commit to grundyboy34/Armory-Expansion that referenced this issue Sep 2, 2019
@NickelHub

This comment has been minimized.

Copy link

commented Sep 2, 2019

I have a question to the config .json. I noticed that they are saved every time to game has been started.
Why is that? They just need to be read only.

@YaibaToKen

This comment has been minimized.

Copy link
Owner

commented Sep 3, 2019

Because if the file is missing info or has invalid data, it has to be rewritten.
I will however, look into a way to validate the file and copy it's contents to a #.json.err file before rewriting it.

@YaibaToKen

This comment has been minimized.

Copy link
Owner

commented Sep 4, 2019

Fixed it, I'll make a pull request. Although, I had to drop ice and fire to 1.7 in order for gradle to find it.
Without a pull request, the fix is simply commenting out three lines as such in this file. This still allows the conarm-materials.json values to be tweaked and used.
https://github.com/YaibaToKen/Armory-Expansion/blob/master/src/main/java/org/softc/armoryexpansion/common/integration/modsupport/ConArmIntegration.java

 @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        this.modid = ConstructsArmory.MODID;
        this.logger = event.getModLog();
        this.configDir = event.getModConfigurationDirectory().getPath();
        if (ArmoryExpansion.isIntegrationEnabled(modid)){
            this.loadMaterialsFromOtherIntegrations(event);
            this.setIntegrationData(this.configDir);
            this.integrationConfigHelper.syncConfig(this.materials);
            this.saveIntegrationData(this.configDir);
           // this.registerMaterials();
           // this.registerAlloys();
           // this.registerMaterialStats();
        }
        ArmoryExpansion.config.save();
    }

Sorry, only saw this just now.
Commenting those lines also means that the armor parts are never generated. Though, this.registerMaterials() and this.registerAlloys shouldn't be there iirc... I'll tinker with that and let you know if it fixes everything.
Meanwhile, thanks to all of you for the help fixing this.

@grundyboy34

This comment has been minimized.

Copy link

commented Sep 4, 2019

Ahh I didn't test that change with no configs to see if it generates them, which I should do.
As far as I'm aware as to why it works to load the configs though is that the same code in preInit is also right below it in the registerItems event. From what I could tell with testing, it seems the checks to see if a material is in the tinker registry before registering the material fails to detect some materials in the preInit stage, which the only reason I can think would be happening is because there isn't a guarantee that your mod runs its preInit code after all other mods have ran theirs.

@Landmaster

This comment has been minimized.

Copy link

commented Sep 4, 2019

which the only reason I can think would be happening is because there isn't a guarantee that your mod runs its preInit code after all other mods have ran theirs.
PlusTiC actually runs some integration code in RegistryEvent.Register<Item> due to the late registration of some mods' items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.