Regenerating Code Deletes Core Files (Help Request)

Started by Mindthemoods on

Topic category: Help with MCreator software

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Regenerating Code Deletes Core Files (Help Request)
Thu, 07/13/2023 - 03:33 (edited)

After updating to the latest Patch, attempting to compile one of my mods results in the majority of the mod elements giving compilation errors such as the following:

C:\Users\prcri\MCreatorWorkspaces\superiorstructures\src\main\java\net\mcreator\superiorstructures\procedures\MansionFrontWingProcedure.java:13: error: cannot find symbol 
import net.mcreator.superiorstructures.init.SuperiorstructuresModGameRules; 
                                           ^ 
  symbol:   class SuperiorstructuresModGameRules 
  location: package net.mcreator.superiorstructures.init
C:\Users\prcri\MCreatorWorkspaces\superiorstructures\src\main\java\net\mcreator\superiorstructures\init\SuperiorstructuresModEntities.java:117: error: cannot find symbol 
   public static final RegistryObject<EntityType<EnergyRail2Entity>> ENERGY_RAIL_2 = register("projectile_energy_rail_2", 
                                                 ^ 
  symbol:   class EnergyRail2Entity 
  location: class SuperiorstructuresModEntities
C:\Users\prcri\MCreatorWorkspaces\superiorstructures\src\main\java\net\mcreator\superiorstructures\block\LaserBeamHalfBlock.java:43: error: cannot find symbol 
import net.mcreator.superiorstructures.procedures.LaserBeamUpdateTickProcedure; 
                                                 ^ 
  symbol:   class LaserBeamUpdateTickProcedure 
  location: package net.mcreator.superiorstructures.procedures

Overall about 90% of the Mod elements are giving said errors. Regenerating the code causes the number to vary, but it usually remains about the same. However, updating other mods to the latest patch does not result in this issue. (That being said, this is my largest mod, at around 2,300 elements, along with a lot of locked code, structure, and texture files.) The Editor mostly works fine, but some elements cannot be opened, and many are either missing their thumbnail or have the wrong thumbnail displayed.

...Weirdly, this also isn't the first time this particular mod has done this. The last time this issue came up, (updating from 2023.1 to an earlier version of 2023.2), I was able to open a backup in the previous version; but the pre-patch version is no longer available, and I overwrote it instead of deleting it when I downloaded the new version. It seems like the mod is missing a bunch of important main-components, but I'm really not sure how to resolve this issue, and have tried quite a few different courses of action.

Opening the src files reveals that there are quite a few java files missing in the broken workspace. Restoring these files seems to help, (to a point). However, there are also several important 'init' files missing, including the ModItems and ModRenders files, which even when restored are deleted upon regeneration. (Trying to compile after restoring these prompts me to regenerate the workspace, deleting them again, and causing the same problem.) However, compiling after these are restored results in a bunch of 'Missing Package' errors saying that the package for the ModItems file doesn't exist.

I'll keep updating this if I make any progress; I'm curious if anyone has a similar issue.

 

Edited by Mindthemoods on Thu, 07/13/2023 - 03:33
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Updating to the latest…
Sat, 07/15/2023 - 14:17

Updating to the latest workspace initially broke things, but I've been using the same one since. I did at one point try updating to the latest snapshot, and backdating to 2023.1, but I backed up and later restored the original workspace both times, and it didn't appear to make any difference. 

The problem did initially start even longer ago when I updated from 2023.1 to 2023.2, but in that case the problem was resolved for over a month or so after I loaded backups and opened the workspace in 2023.1. (It later successfully updated to the pre-patch version of 2023.2.)

Anyways, here's a link to the workspace. I can't thank you enough for looking into this!

SuperiorStructuresBrokenWorkspace (mediafire.com)

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
*Updating to the latest…
Sat, 07/15/2023 - 14:31

*Updating to the latest Mcreator version.* 

Also, regenerating the above workspace in its current state seems to delete the ModItem and ModEntity files, causing a lot more errors. Building just yields all the 'package does not exist' errors.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, I manually went through…
Sun, 07/16/2023 - 20:04

So, I manually went through and regenerated the code of the elements that were giving errors, (just locking and unlocking everything), updated Geckolib, and eventually was able to fix the mod: at this point, it does work like normal. I looked into the code, and, in addition to deleting ModItems from the init file, regenerating the code was somehow removing imports of the ModItems file from unlocked elements that referenced it. Manually restoring these inports eventually resolved the errors, but regenerating the code reverts all these fixes.

...Which isn't as much of an issue anymore as I now have a backup with mostly fixed sourcecode, but it does make it quite a bit more difficult to update to a new version, and there may be further errors I haven't noticed yet. (Some of the Element thumbnails seem to be broken, and a couple blocks have seemingly switched code.) However, it does WORK, which is quite a relief.

Here's a link to the mostly fixed workspace. I'm still not sure what's causing the issue, but hoping this is the end of it.

https://www.mediafire.com/file/i7w1x32ahco6gqz/SuperiorStructuresFixed(Maybe).zip/file 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's really quite strange. I…
Sun, 07/16/2023 - 21:27

It's really quite strange. I'm still having a couple issues with mod elements that appear to either be missing code or using the code of other elements. Regenerating fixes this, but still causes the problem mentioned above.

Whenever the code is regenerated, the ModItems and ModEntities files are removed from the src. They no longer appear in SuperiorstructuresMod; in the init file, or in any of the imports of unlocked code.

...At this point I think I ought to put this on the Github issue tracker. Here's hoping for the best.