lilypuree / UnEarthed

Geologic Minecraft Mod
Other
16 stars 16 forks source link

Fix dynamic trees compatibility #85

Open Harleyoc1 opened 2 years ago

Harleyoc1 commented 2 years ago

This crash was reported in the DT Discord server recently: crash-2022-03-20_19.51.20-fml.txt

Having looked into it, this is caused by the DT compatibility in this mod. This needs to be executed in the mod constructor, not common setup (because the registry handler handles registering blocks and items so must be created before registration, not after). This PR fixes that.

It also fixes block states not using the correct registry names. To simplify the block states I also generated them using DT's automatic data generators. I also moved the generated blockstates into the regular resources folder to respect the compileOnly configuration of the dependency on DT (as DT is required at runtime of data gen to generate the models each time, and so they would be removed each time you regenerate if left in the generated resources folder).

lilypuree commented 2 years ago

Please leave the generated blockstates in the generated folder.... isn't there a way to just only generate the models that are required by DT, not everything else? the Unearthed generated data is on /generated for making it easier for me to make changes, not going through each and every file every time I want to change something. And it's not meant to be called on runtime either.

Harleyoc1 commented 2 years ago

I'm not sure what you mean? The DT generators work in the same way as any others, it's just that Dynamic Trees itself needs to be present when the runData task is run (which is not possible when set to compileOnly on Gradle). The problem with leaving them in the generated folder is they are removed if the DT generators don't exist during the runData task (causing them to be removed as the generators replace the entire blockstates folder). So, if they are added back as soon as you perform the runData task again they would be removed unless you had DT set to implementation or similar in Gradle.

Harleyoc1 commented 2 years ago

I'm not sure whether or not Forge provide a special runtime configuration that includes a specific mod during runData only, if so that could solve this problem.