Workspace missing ModItems initialization file

Started by Mariano Argüello on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 12:44, 17. Apr 2024
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Workspace missing ModItems initialization file
Sat, 03/02/2024 - 20:58 (edited)

I've been having a lot of issues lately on my Workspace regarding the initialization file for the Items of my mod. Essentially the file "AlterlandsModItems.java" (My mod is called Alterlands) doesn't get re-generated when regenerating the code of the entire model. I tried everything to make it work, regenerated the code like a million times with no result, tried to copy the file from an old save I had of the workspace, but the thing with that is that that file is outdated, and also MCreator doesn't update it, and when I regenerate the code again, it just outright deletes it. I don't get why this happens, never seen anything like this before. My Workspace has like 6.5k elements and I get that it's a big one but never had issues with this kind of stuff until now. Anyone has any idea on why this keeps happening? I've disabled all my plugins but it keeps happening, so I have no idea on how to fix it. 

This is my Workspace exported into a Zip

My theory is that another error is causing the init file to not be created at all. I've noticed that on my Items, for some reason MCreator is automatically importing the "net.minecraft.client.resources.Model" package (And it is useless because the code doesn't need it at all), but there's already an import called "net.minecraft.world.level.Material" and so both fight for the same name, being "Material". It's odd because that happens automatically, like I regen my code and that new import is already placed in every single block and item, and that's an issue because I can't fix every single block and item and remove the line, also that would mean I have to code-lock every element and that doesn't need to happen. Essentially something is adding that import line and that breaks my items and blocks, and maybe that's why my init file isn't generating at all. Don't know, but maybe it's useful info for someone to help

Since then I've got several weird errors, for example my gradle log now only shows that my dimension portal is broken, and this is now the code that the element shows:

package net.mcreator.alterlands.world.teleporter; 
public class AlterlandsDimensionPortalShape /* failed to load code for net.minecraft.world.level.portal.PortalShape */

I assume that part of this is due to my internet connection being poor (4 mbps) Or that my Workspace may be corrupted. I cannot rebuild the mod from the ground at this point. Any help with these issues will be greatly appreciated!

But going back to the Item initialization problem, down below is an image from my init folder inside my Workspace, it's clearly missing the Item.java init file, that should go between the two marked with a green line.

If more info is needed, please comment on this post so I can provide more info about anything required

 

Edited by Mariano Argüello on Sat, 03/02/2024 - 20:58
This can happen due to…
Sun, 03/03/2024 - 14:05

This can happen due to plugins.

This error:

failed to load code for net.minecraft.world.level.portal.PortalShape */

https://mcreator.net/support/knowledgebase -> Gradle task compileJava FAILED with errors of type "Override is not a repeatable annotation type" or "failed to load code"

Last seen on 18:13, 17. Apr 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just disabling APIs plugins…
Sun, 03/03/2024 - 14:50

Just disabling APIs plugins add doesn't disable the plugins. Make sure your plugin folder is actually empty.

Last seen on 12:44, 17. Apr 2024
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for the quick…
Mon, 03/04/2024 - 01:59

Thank you for the quick answer guys! I do have a question about plugins. My workspace uses your Config file, Geckolib and Blockstates plugin, Nerdy. What happens if I disable all plugins (drag them out of the plugin folder) and then re-open my workspace? What happens with the procedures I made with the plugins? They stay normal or do they break? Thank you both in advance! I'll try that if I know disabling every plugin is in fact safe, as a lot of procedures on my mod depend specifically on the config plugin and I had to rebuild them when updating to 2023.3, that was a lot of work and I don't feel like doing it again (If possible, of course)

Last seen on 18:13, 17. Apr 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No it's not safe. What I…
Mon, 03/04/2024 - 02:27

No it's not safe. What I suggest you do instead is remove all the plugins you have and install their latest versions, then open the workspace and regenerate the code.

Last seen on 18:13, 17. Apr 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But ensure the versions you…
Mon, 03/04/2024 - 02:28

But ensure the versions you download support your mcreator version.

Last seen on 12:44, 17. Apr 2024
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Another last question, I…
Mon, 03/04/2024 - 15:21

Another last question, I have two plugin folders on my computer (One in my user -> .mcreator -> plugins and another one inside program files -> Pylo -> MCreator -> plugins) Both of them seem to work when checking for plugins. Should I use one over the other? I tested placing the plugins in one, then the other and both seem to work fine, but don't wanna risk it. If anyone can be used I'll place the newly downloaded plugins on the folder and try regenerating the code