Code inside locked duplicated elements are not changed

Published by Goldorion on Sun, 08/02/2020 - 03:32
Works as designed
Not applicable
MCreator version
Issue description


I continued a little bit farm Adventure II and I duplicated a mod element that is locked. However, I checked the code because I got an error, and I discover that all the code was the same that the original mod element So, to resume, when you duplicate a locked mod element, its code is not changed with the name of it. For example, in this case, I duplicated the locked mod element LindenForest (a biome). I renamed it WesternCedarForest, but everything in the code that contains the name of the element (e.g. the class name and the registry name) is still with the name of the Linden Forest, instead to have the name of the Western Cedar Forest. I tested with an unlocked mod element without open it, and it doesn't happen.

The workspace is attached to the workspace. I don't think the error is needed as it only says the name of the class is not good, but here it is.

C:\Users\\MCreatorWorkspaces\farm_adventure\src\main\java\goldorion\farm_adventure\world\biome\ error: class LindenForestBiome is public, should be declared in a file named public class LindenForestBiome extends FarmAdventureIiModElements.ModElement {
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
1 actionable task: 1 executed
Task completed in 7135 milliseconds


Issue comments

This is normal. Once you lock the code, MCreator will not touch the code.

There is no refactoring mechanisms implemented that would refactor your code, this is a bit out of scope, I believe you can imagine :D