Code regeneration is deleting element source files

Started by Radikid on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 23:30, 25. Apr 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Code regeneration is deleting element source files

I spontaneously started getting build errors with a sword in my mod. I couldn't fix it, so I loaded an autosave backup from the previous day. When I ran the client for a test the sword seemed to be entirely missing from the game, even though the element was visible in MCreator. I wanted to edit the code of the sword to see if anything looked weird, but found that the edit button wasn't doing anything. I went to modid/src/main/java/net/modid/item and looked for the sword there to manually open the .java file in a text editor when I found that it was completely missing! I ended up using a hacktool to decompile the current version of my mod and from the source of it retrieved another sword .java file. I copied this file to my mod's .../modid/item directory and regenerated the code (I read the pinned thread here). When I regenerated the code, it literally deleted my sword's .java file. I don't know why it's doing this, and I don't know why it is happening seemingly on a whim. Keep in mind that the backup I loaded was from the previous day, so none of my recent edits could have affected this, I don't believe.

If anyone could help me fix this, I would really appreciate it! :)

Last seen on 23:30, 25. Apr 2022
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I may have found the issue…
Sat, 06/12/2021 - 13:52

I may have found the issue. Yesterday or the day before I had added a right-clicked-in-air trigger to the sword to play around. Once I was finished, I deleted it. It seems that deleting it had some adverse effect on the sword that wasn't apparent until now. I went into the sword's trigger page and, while it showed that no procedures were selected for any of the triggers, I made sure by manually selecting the "(no procedure)" option.

Last seen on 16:02, 15. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm having something of a…
Wed, 07/12/2023 - 02:59

I'm having something of a similar problem, but more on the extreme side; regenerating my mod's code deletes files from the same location; the missing elements still appear in Mcreator, but cannot be opened, and yield compilation errors. I've tried restoring the files from backups manually, but it just reverts whenever the code regenerates. 

Any ideas? I'm having trouble finding people with a similar issue.

Would you mind uploading the…
Fri, 07/14/2023 - 13:18

Would you mind uploading the workspace? We can try to check it if it is not too broken / complex / big